-
Notifications
You must be signed in to change notification settings - Fork 12
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 #441 from lidofinance/feature/si-1562-rerturn-unsu…
…pported-banner-to-reward-page feat: return unsupported banner to reward page
- 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.