-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from lidofinance/develop
Merge into main from develop
- Loading branch information
Showing
37 changed files
with
1,167 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<svg width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<circle cx="26" cy="26" r="26" fill="black" fill-opacity="0.1"/> | ||
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.8818 19.8789C32.8818 23.697 29.8204 26.7585 25.9996 26.7585C22.1801 26.7585 19.1174 23.697 19.1174 19.8789C19.1174 16.0607 22.1801 13.0005 25.9996 13.0005C29.8204 13.0005 32.8818 16.0607 32.8818 19.8789ZM25.9996 39.0005C20.3607 39.0005 15.5996 38.084 15.5996 34.5479C15.5996 31.0106 20.3906 30.1266 25.9996 30.1266C31.6398 30.1266 36.3996 31.0431 36.3996 34.5791C36.3996 38.1165 31.6086 39.0005 25.9996 39.0005Z" fill="#3C4254" fill-opacity="0.28"/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.25 16C12.6683 16 16.25 12.4183 16.25 8C16.25 3.58172 12.6683 0 8.25 0C3.83172 0 0.25 3.58172 0.25 8C0.25 12.4183 3.83172 16 8.25 16ZM10.6101 6.94893L8.25313 3.33333L5.89622 6.94889L8.25301 8.29511L10.6101 6.94893ZM8.25313 4.26917L6.61772 6.77792L8.25303 7.71202L9.88855 6.77793L8.25313 4.26917ZM5.51552 7.52807L8.24965 9.08982L8.24976 9.08989L10.9845 7.52804L11.0591 7.6426C11.9012 8.93441 11.7132 10.6262 10.607 11.7101C9.30525 12.9855 7.19475 12.9855 5.89302 11.7101C4.78683 10.6262 4.59876 8.93441 5.44086 7.6426L5.51552 7.52807Z" fill="#7A8AA0"/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.25 8C0.25 3.58172 3.83172 0 8.25 0C12.6683 0 16.25 3.58172 16.25 8C16.25 12.4183 12.6683 16 8.25 16C3.83172 16 0.25 12.4183 0.25 8ZM12.3692 4H11.046L8.8656 6.4924L6.9804 4H4.25L7.5124 8.266L4.4204 11.8H5.7444L8.1308 9.0732L10.2164 11.8H12.8792L9.4784 7.304L12.3692 4ZM11.3148 11.008H10.5816L5.7952 4.7504H6.582L11.3148 11.008Z" fill="#7A8AA0"/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { BigNumber } from 'ethers' | ||
|
||
export const SNAPSHOT_LIDO_SPACE_NAME = | ||
'0x6c69646f2d736e617073686f742e657468000000000000000000000000000000' // lido-snapshot.eth | ||
|
||
export const DELEGATORS_PAGE_SIZE = 10 | ||
export const DELEGATORS_FETCH_SIZE = 50 | ||
export const DELEGATORS_FETCH_TOTAL = 200 | ||
export const VP_MIN_TO_SHOW = BigNumber.from(10).pow(16) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
modules/delegation/providers/DelegateFromPublicListContext.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { createContext, FC, useCallback, useContext, useState } from 'react' | ||
import invariant from 'tiny-invariant' | ||
|
||
// | ||
// Data context | ||
// | ||
|
||
type Value = { | ||
selectedPublicDelegate: string | undefined | ||
onPublicDelegateSelect: (address: string) => () => void | ||
onPublicDelegateReset: () => void | ||
} | ||
|
||
const DelegateFromPublicListContext = createContext<Value | null>(null) | ||
|
||
export const useDelegateFromPublicList = () => { | ||
const value = useContext(DelegateFromPublicListContext) | ||
invariant( | ||
value, | ||
'useDelegateFromPublicList was used outside the DelegateFromPublicListContext provider', | ||
) | ||
return value | ||
} | ||
|
||
export const DelegateFromPublicListProvider: FC = ({ children }) => { | ||
const [selectedPublicDelegate, setSelectedPublicDelegate] = useState<string>() | ||
|
||
const handleDelegatePick = useCallback( | ||
(address: string) => () => { | ||
setSelectedPublicDelegate(address) | ||
}, | ||
[], | ||
) | ||
|
||
const handleDelegateReset = useCallback(() => { | ||
setSelectedPublicDelegate(undefined) | ||
}, []) | ||
|
||
return ( | ||
<DelegateFromPublicListContext.Provider | ||
value={{ | ||
selectedPublicDelegate, | ||
onPublicDelegateSelect: handleDelegatePick, | ||
onPublicDelegateReset: handleDelegateReset, | ||
}} | ||
> | ||
{children} | ||
</DelegateFromPublicListContext.Provider> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.