generated from defi-wonderland/web3-react-boilerplate
-
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.
closes ZKS-166 closes ZKS-167 closes ZKS-174 closes ZKS-175 closes ZKS-176 closes ZKS-177 closes ZKS-178 closes ZKS-171 closes ZKS-179
- Loading branch information
Showing
24 changed files
with
273 additions
and
231 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { Grid } from '@mui/material'; | ||
import { useTranslation } from 'next-i18next'; | ||
|
||
import { TvlData, TotalValueLockedProps } from '~/types'; | ||
import { TvlContentBox, GridContainer, TvlContainer, OthersText, OthersBox } from '~/components'; | ||
|
||
export const DesktopTvlContainer = ({ tvl }: TotalValueLockedProps) => { | ||
const { t } = useTranslation(); | ||
|
||
const renderTvlContent = ( | ||
data: TvlData, | ||
index: number, | ||
height: string, | ||
xs: number, | ||
smallCard?: boolean, | ||
isLast?: boolean, | ||
) => ( | ||
<Grid item xs={xs} key={index}> | ||
<GridContainer imageUrl={data.imageUrl} height={height} smallCard={smallCard}> | ||
<TvlContentBox | ||
avatar={data.imageUrl} | ||
token={data.symbol} | ||
total={data.amountUsd} | ||
tokenName={data.name} | ||
isLast={isLast} | ||
/> | ||
</GridContainer> | ||
</Grid> | ||
); | ||
|
||
return ( | ||
<TvlContainer container spacing={0.5}> | ||
{/* First item: full width */} | ||
{renderTvlContent(tvl[0], 0, '12rem', 12)} | ||
|
||
<Grid item container xs={12} spacing={0.5}> | ||
{/* Second item: half width */} | ||
{renderTvlContent(tvl[1], 1, '12rem', 6)} | ||
|
||
<Grid item container xs={6} spacing={0.5}> | ||
{/* Third and fourth items: one-third width each*/} | ||
{tvl.slice(2, 4).map((data, index) => renderTvlContent(data, index + 2, '12rem', 4, true))} | ||
|
||
<Grid item container xs={4} direction='column'> | ||
{/* Fifth item: one-third width and half height */} | ||
{renderTvlContent(tvl[4], 4, '5.85rem', 6, true)} | ||
|
||
<Grid item container xs={6} spacing={0.5}> | ||
{/* Sixth item: three-fourths width and halft height + others remaining width same height*/} | ||
{renderTvlContent(tvl[5], 5, '5.85rem', 9, true, true)} | ||
<Grid item xs={3}> | ||
<GridContainer height='5.85rem'> | ||
<OthersBox> | ||
<OthersText>{t('HOME.LOCKEDASSETS.others')}</OthersText> | ||
</OthersBox> | ||
</GridContainer> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</TvlContainer> | ||
); | ||
}; |
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,63 @@ | ||
import { Grid } from '@mui/material'; | ||
import { useTranslation } from 'next-i18next'; | ||
|
||
import { TvlData, TotalValueLockedProps } from '~/types'; | ||
import { TvlContentBox, GridContainer, TvlContainer, OthersText, OthersBox } from '~/components'; | ||
|
||
export const MobileTvlContainer = ({ tvl }: TotalValueLockedProps) => { | ||
const { t } = useTranslation(); | ||
|
||
const renderTvlContent = ( | ||
data: TvlData, | ||
index: number, | ||
height: string, | ||
xs: number, | ||
smallCard?: boolean, | ||
isLast?: boolean, | ||
) => ( | ||
<Grid item xs={xs} key={index}> | ||
<GridContainer imageUrl={data.imageUrl} height={height} smallCard={smallCard}> | ||
<TvlContentBox | ||
avatar={data.imageUrl} | ||
token={data.symbol} | ||
total={data.amountUsd} | ||
tokenName={data.name} | ||
isLast={isLast} | ||
/> | ||
</GridContainer> | ||
</Grid> | ||
); | ||
|
||
return ( | ||
<TvlContainer container spacing={0.5}> | ||
{/* First item: full width */} | ||
{renderTvlContent(tvl[0], 0, '12rem', 12)} | ||
|
||
{/* Second item: full width, half height */} | ||
{renderTvlContent(tvl[1], 1, '6rem', 12)} | ||
|
||
{/* Third and Fourth items: half width each */} | ||
<Grid item container xs={12} spacing={0.5}> | ||
{renderTvlContent(tvl[2], 2, '6rem', 6)} | ||
{renderTvlContent(tvl[3], 3, '6rem', 6)} | ||
</Grid> | ||
|
||
{/* Fifth item: half width */} | ||
<Grid item container xs={12} spacing={0.5}> | ||
{renderTvlContent(tvl[4], 4, '5rem', 6, true, true)} | ||
|
||
{/* Sixth item: two-thirds width + others remaining */} | ||
<Grid item container xs={6} spacing={0.5}> | ||
{renderTvlContent(tvl[5], 5, '5rem', 9, true, true)} | ||
<Grid item xs={3}> | ||
<GridContainer height='5rem'> | ||
<OthersBox> | ||
<OthersText>{t('HOME.LOCKEDASSETS.others')}</OthersText> | ||
</OthersBox> | ||
</GridContainer> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</TvlContainer> | ||
); | ||
}; |
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.