-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [lw-11830]: resolve pr comments
- Loading branch information
Showing
5 changed files
with
56 additions
and
41 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
File renamed without changes.
48 changes: 48 additions & 0 deletions
48
...es/send-transaction/components/Form/LockedStakeRewardsBanner/LockedStakeRewardsBanner.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,48 @@ | ||
import cn from 'classnames'; | ||
import { useHistory } from 'react-router-dom'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Banner } from '@lace/common'; | ||
import { walletRoutePaths } from '@routes'; | ||
import styles from './LockedStakeRewardsBanner.module.scss'; | ||
import { Box, Button, Flex, Text } from '@input-output-hk/lace-ui-toolkit'; | ||
import { useDrawer } from '@src/views/browser-view/stores'; | ||
import ExclamationCircleOutline from '@src/assets/icons/red-exclamation-circle.component.svg'; | ||
|
||
export type LockedStakeRewardsBannerProps = { | ||
isPopupView?: boolean; | ||
}; | ||
|
||
export const LockedStakeRewardsBanner = ({ isPopupView }: LockedStakeRewardsBannerProps): React.ReactElement => { | ||
const { t } = useTranslation(); | ||
const history = useHistory(); | ||
const [, setIsDrawerVisible] = useDrawer(); | ||
|
||
const onGoToStaking = () => { | ||
const path = isPopupView ? walletRoutePaths.earn : walletRoutePaths.staking; | ||
setIsDrawerVisible(); | ||
history.push(path); | ||
}; | ||
|
||
return isPopupView ? ( | ||
<Flex className={styles.bannerPopup} flexDirection="column" py="$16" px="$24" gap="$24"> | ||
<Text.Button>{t('general.errors.lockedStakeRewards.description')}</Text.Button> | ||
<Button.CallToAction | ||
w="$fill" | ||
onClick={onGoToStaking} | ||
data-testid="stats-register-as-drep-cta" | ||
label={t('general.errors.lockedStakeRewards.cta')} | ||
/> | ||
</Flex> | ||
) : ( | ||
<Banner | ||
customIcon={<ExclamationCircleOutline />} | ||
popupView={isPopupView} | ||
className={cn(styles.banner, { [styles.popupView]: isPopupView })} | ||
message={<Box className={styles.bannerDescription}>{t('general.errors.lockedStakeRewards.description')}</Box>} | ||
buttonMessage={t('general.errors.lockedStakeRewards.cta')} | ||
onButtonClick={onGoToStaking} | ||
withIcon | ||
/> | ||
); | ||
}; |
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