-
Notifications
You must be signed in to change notification settings - Fork 13
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 #444 from lidofinance/develop
Develop to main
- Loading branch information
Showing
12 changed files
with
133 additions
and
71 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
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
32 changes: 32 additions & 0 deletions
32
features/rewards/components/rewardsListContent/RewardsListsUnsupportedChain.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,32 @@ | ||
import { FC, useMemo } from 'react'; | ||
import { Divider } from '@lidofinance/lido-ui'; | ||
|
||
import { useConfig } from 'config'; | ||
import { CHAINS } from 'consts/chains'; | ||
import { RewardsListEmptyWrapper } from './RewardsListsEmptyStyles'; | ||
|
||
export const RewardsListsUnsupportedChain: FC = () => { | ||
const { | ||
config: { supportedChains }, | ||
} = useConfig(); | ||
|
||
const supportedChainsNames = useMemo(() => { | ||
// 'Chain ID' array to 'Chain name' array exclude unknown chain id | ||
const chains = supportedChains.map((id) => CHAINS[id]).filter(Boolean); | ||
const lastChain = chains.pop(); | ||
// to str | ||
return [chains.join(', '), lastChain].filter((chain) => chain).join(' or '); | ||
}, [supportedChains]); | ||
|
||
return ( | ||
<> | ||
<Divider indents="lg" /> | ||
<RewardsListEmptyWrapper> | ||
<p> | ||
Please switch to {supportedChainsNames} in your wallet to see the | ||
stats. | ||
</p> | ||
</RewardsListEmptyWrapper> | ||
</> | ||
); | ||
}; |
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
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
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
Oops, something went wrong.