-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create ui for 1CY success modal (#210)
- Loading branch information
Showing
5 changed files
with
89 additions
and
3 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
61 changes: 61 additions & 0 deletions
61
src/app/components/modals/successful-flow-modal/icy-successful-flow-modal.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,61 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { Button, HStack, Text, VStack } from '@chakra-ui/react'; | ||
import { OneClickYieldVaultBox } from '@components/one-click-yield-vault-box/one-click-yield-vault-box'; | ||
import { Vault as VaultModel } from '@models/vault'; | ||
|
||
import { ModalComponentProps } from '../components/modal-container'; | ||
import { ModalVaultLayout } from '../components/modal.vault.layout'; | ||
|
||
interface IcySuccessfulFlowModalProps extends ModalComponentProps { | ||
vaultUUID: string; | ||
vault: VaultModel; | ||
flow: 'mint' | 'burn'; | ||
assetAmount: number; | ||
} | ||
|
||
//modify this function with the unmint flow? | ||
function getModalText(assetAmount?: number): string { | ||
return `You have successfully deposited ${assetAmount} BTC and started earning yield.`; | ||
} | ||
|
||
export function IcySuccessfulFlowModal({ | ||
isOpen, | ||
handleClose, | ||
vault, | ||
assetAmount, | ||
}: IcySuccessfulFlowModalProps): React.JSX.Element { | ||
const navigate = useNavigate(); | ||
|
||
function handleNavigateToMyVaults() { | ||
navigate('/my-vaults'); | ||
if (handleClose) { | ||
handleClose(); | ||
} | ||
} | ||
return ( | ||
<ModalVaultLayout title={'Success!'} isOpen={isOpen} onClose={() => handleClose()}> | ||
<VStack w={'100%'} spacing={'25px'}> | ||
<HStack w={'100%'}> | ||
<Text color={'grey.01'} fontSize={'sm'}> | ||
{getModalText(assetAmount)} | ||
</Text> | ||
</HStack> | ||
<OneClickYieldVaultBox oneClickYieldVault={vault} /> | ||
<Button | ||
variant={'depositBTC'} | ||
w={'100%'} | ||
p={'2.5px'} | ||
bg={'orange.01'} | ||
color={'white.01'} | ||
fontSize={'sm'} | ||
fontWeight={'bold'} | ||
_hover={{ bg: 'white.01', color: 'orange.01' }} | ||
onClick={() => handleNavigateToMyVaults()} | ||
> | ||
View in My Vaults | ||
</Button> | ||
</VStack> | ||
</ModalVaultLayout> | ||
); | ||
} |
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