-
Notifications
You must be signed in to change notification settings - Fork 103
New Staking and Governance banners and modals #4470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 32 commits
cbfdbbd
a900ed5
6497fa3
1e40e68
d10c515
9a65f3f
54756ee
dda0000
3272b4b
dd8607e
ada4b10
feb243e
55b81de
961ff9f
2c4e08a
1de4289
38f5952
7159c2f
c4e4c35
c95ec08
44443ef
e10521c
8510b8a
921df40
0ccf51a
984d35c
6efe696
38948a6
85719bf
bc9c079
3c505cb
4f0bf46
0c3a933
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { useStrings } from '../../common/hooks/useStrings'; | ||
| import { DelegateButton } from '../../features/staking/useCases/DelegatedStakePoolInfo/DelegateButton'; | ||
| import { BaseBanner } from './BaseBanner'; | ||
| import type { StoresMap } from '../../../stores'; | ||
| import { useYoroiRemoteConfig } from '../../common/hooks/useYoroiRemoteConfig'; | ||
|
|
||
| interface UsdaBannerProps { | ||
| onClose?: () => void; | ||
| onClick?: () => void; | ||
| displayIllustration?: boolean; | ||
| stores: StoresMap; | ||
| } | ||
|
|
||
| export const RewardsBanner = ({ onClose, stores, displayIllustration = false }: UsdaBannerProps) => { | ||
| const { rewardsButton, earnRewards, delegateRewards } = useStrings(); | ||
| const { data } = useYoroiRemoteConfig(); | ||
| const yoroiPoolID = data?.banners?.earnRewardsWithYoroi?.poolId; | ||
| const yoroiPoolName = data?.banners?.earnRewardsWithYoroi?.poolName; | ||
|
|
||
| const handleClose = () => { | ||
| onClose && onClose(); | ||
| }; | ||
|
|
||
| return ( | ||
| <BaseBanner | ||
| noClose | ||
| onClose={handleClose} | ||
| title={earnRewards} | ||
| description={delegateRewards} | ||
| buttonText={rewardsButton} | ||
| buttonProps={{ | ||
| onClick: () => {}, | ||
| // @ts-ignore | ||
| variant: 'secondary', | ||
| sx: { | ||
| width: 'fit-content', | ||
| height: '40px', | ||
| '&.MuiButton-sizeMedium': { | ||
| p: '9px 20px', | ||
| }, | ||
| }, | ||
| }} | ||
| displayIllustration={displayIllustration} | ||
| customButton={ | ||
| <DelegateButton | ||
| btnVariant="secondary" | ||
| stores={stores} | ||
| label={rewardsButton} | ||
| disabled={false} | ||
| poolID={yoroiPoolID || ''} | ||
| poolName={yoroiPoolName || ''} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty pool ID passed to delegation on mainnet
Additional Locations (1) |
||
| socialMediaInfo={undefined} | ||
| delegateAndStake | ||
| /> | ||
| } | ||
| /> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { useNavigate } from 'react-router'; | ||
| import React from 'react'; | ||
| import { ROUTES } from '../../../../../routes-config'; | ||
|
|
||
| export const useNavigateTo = () => { | ||
| const navigate = useNavigate(); | ||
|
|
||
| return React.useRef({ | ||
| selectRevampStatus: () => navigate(ROUTES.GOVERNANCE.ROOT), | ||
| }).current; | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.