Skip to content
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

Realigment on mobile volume 24h component #319

Merged
merged 11 commits into from
Jan 14, 2025
3 changes: 3 additions & 0 deletions src/components/Stats/volumeBar/VolumeBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const VolumeBar: React.FC<Iprops> = ({
className={classNames({ [classes.loadingOverlay]: isLoading })}>
<Box className={classes.tokenName}>
<Typography className={classes.tokenHeader}>Volume 24H:</Typography>

<Typography className={classes.tokenContent}>
${formatNumber(isLoading ? Math.random() * 10000 : volume)}
</Typography>
Expand All @@ -63,6 +64,7 @@ const VolumeBar: React.FC<Iprops> = ({
</Box>
<Box className={classes.tokenName}>
<Typography className={classes.tokenHeader}>TVL 24H:</Typography>

<Typography className={classes.tokenContent}>
${formatNumber(isLoading ? Math.random() * 10000 : tvlVolume)}
</Typography>
Expand All @@ -78,6 +80,7 @@ const VolumeBar: React.FC<Iprops> = ({
</Typography>
)}
</Box>

<Box className={classes.tokenName}>
<Typography className={classes.tokenHeader}>Fees 24H:</Typography>
<Typography className={classes.tokenContent}>
Expand Down
84 changes: 76 additions & 8 deletions src/components/Stats/volumeBar/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,103 @@ export const useStyles = makeStyles()(() => ({
width: '100%',
backgroundColor: colors.invariant.component,
borderRadius: 22,
padding: 20,
padding: '20px 24px',
display: 'flex',
whiteSpace: 'nowrap',
justifyContent: 'space-between'
flexDirection: 'row',
flexWrap: 'wrap',
gap: 8,
justifyContent: 'space-between',

[theme.breakpoints.down('sm')]: {
padding: '12px 24px',
gap: 8,
flexDirection: 'column'
}
},

tokenName: {
display: 'flex',
whiteSpace: 'nowrap',
alignItems: 'center',
minWidth: 'auto',
flex: '1 1 auto',
gap: 4,

[theme.breakpoints.down('sm')]: {
justifyContent: 'space-between',

'& p': {
...typography.caption2
...typography.body2,
whiteSpace: 'nowrap'
}
},

[theme.breakpoints.down('xs')]: {
'& p': {
...typography.caption4
whiteSpace: 'nowrap'
},
flex: '0 0 auto',
width: '100%',
justifyContent: 'center'
},

'&:nth-of-type(3)': {
[theme.breakpoints.down('md')]: {
width: '100%',
justifyContent: 'center'
},
[theme.breakpoints.down('sm')]: {
justifyContent: 'space-between'
},
[theme.breakpoints.up('md')]: {
justifyContent: 'flex-end'
}
},

'&:nth-of-type(2)': {
justifyContent: 'center',
textAlign: 'center'
},
'&:nth-of-type(1), &:nth-of-type(2)': {
[theme.breakpoints.down('md')]: {
justifyContent: 'center',
textAlign: 'center'
},

' &:nth-of-type(3), &:nth-of-type(1), &:nth-of-type(2)': {
[theme.breakpoints.down('sm')]: {
justifyContent: 'space-between'
}
}
}
},

tokenHeader: {
...typography.heading4,
color: colors.invariant.textGrey
color: colors.invariant.textGrey,
whiteSpace: 'nowrap',

[theme.breakpoints.down('sm')]: {
display: 'flex',
flex: 1,
alignItems: 'center'
}
},

tokenContent: {
...typography.heading4,
color: colors.white.main,
padding: '0 0 0 5px'
whiteSpace: 'nowrap',
[theme.breakpoints.down('sm')]: {
display: 'flex',
flex: 1,
justifyContent: 'center',
alignItems: 'center',

'&:nth-of-type(3)': {
justifyContent: 'flex-end',
textAlign: 'center'
}
}
},

tokenLow: {
Expand All @@ -51,6 +116,9 @@ export const useStyles = makeStyles()(() => ({
color: colors.invariant.green,
fontWeight: 400
},
rightItems: {
display: 'flex'
},
loadingOverlay: {
position: 'relative',
'&::after': {
Expand Down
Loading