-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve deposit flow card titles (#328)
- Loading branch information
Showing
27 changed files
with
207 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { | ||
type ContractCall, | ||
type TokenAmount, | ||
useFieldActions, | ||
} from '@lifi/widget' | ||
import { Avatar, Box, Chip, Stack, Typography } from '@mui/material' | ||
import { useEffect } from 'react' | ||
import { contractTool } from '../config' | ||
|
||
export interface ItemPriceProps { | ||
token: TokenAmount | ||
contractCalls?: ContractCall[] | ||
} | ||
|
||
export const DepositCard: React.FC<ItemPriceProps> = ({ | ||
token, | ||
contractCalls, | ||
}) => { | ||
const { setFieldValue } = useFieldActions() | ||
|
||
useEffect(() => { | ||
if (token) { | ||
setFieldValue('toChain', token.chainId, { isTouched: true }) | ||
setFieldValue('toToken', token.address, { isTouched: true }) | ||
} | ||
if (contractCalls) { | ||
setFieldValue('contractCalls', contractCalls, { | ||
isTouched: true, | ||
}) | ||
} | ||
}, [contractCalls, setFieldValue, token]) | ||
return ( | ||
<Stack spacing={2} padding={2}> | ||
<Box display="flex" alignItems="center" gap={1}> | ||
<Avatar alt="Protocol" src={contractTool.logoURI} /> | ||
<Typography variant="h6" sx={{ fontWeight: 'bold' }}> | ||
Protocol Name | ||
</Typography> | ||
</Box> | ||
<Box display="flex" justifyContent="space-between" gap={2}> | ||
<Box | ||
sx={{ | ||
backgroundColor: 'rgba(0, 0, 0, 0.04)', | ||
borderRadius: 1, | ||
paddingX: 2, | ||
paddingY: 1, | ||
flex: 1, | ||
}} | ||
> | ||
<Typography variant="subtitle2">TVL</Typography> | ||
<Typography variant="h6" sx={{ fontWeight: 'bold' }}> | ||
$69M | ||
</Typography> | ||
</Box> | ||
<Box | ||
sx={{ | ||
backgroundColor: 'rgba(0, 0, 0, 0.04)', | ||
borderRadius: 1, | ||
paddingX: 2, | ||
paddingY: 1, | ||
flex: 1, | ||
}} | ||
> | ||
<Typography variant="subtitle2">Incentives</Typography> | ||
<Typography variant="h6" sx={{ fontWeight: 'bold' }}> | ||
$4.2M | ||
</Typography> | ||
</Box> | ||
</Box> | ||
<Box display="flex" gap={1}> | ||
<Chip label="USDC" avatar={<Avatar alt="USDC" src={token.logoURI} />} /> | ||
<Chip | ||
label="Vault" | ||
avatar={ | ||
<Avatar | ||
alt="Vault" | ||
src={'https://gravatar.com/avatar/any?d=retro'} | ||
/> | ||
} | ||
/> | ||
</Box> | ||
</Stack> | ||
) | ||
} |
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,4 @@ | ||
export const contractTool = { | ||
logoURI: 'https://gravatar.com/avatar/any?d=wavatar', | ||
name: 'Protocol Name', | ||
} |
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
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.