-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webapp): implement design of nonCompliant BPs section
refactor(webapp): add NonCompliantCard component feat(webapp): apply design for rewards distribution section chore(webapp): fix margins and spacing
- Loading branch information
1 parent
c32acfa
commit b74ed21
Showing
14 changed files
with
413 additions
and
280 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react' | ||
|
||
const NonCompliant = () => ( | ||
<svg | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M15.167 17.5v-1.667a3.333 3.333 0 0 0-3.333-3.333H5.167a3.333 3.333 0 0 0-3.333 3.333V17.5" | ||
stroke="#000" | ||
strokeWidth="2" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
/> | ||
<path | ||
clipRule="evenodd" | ||
d="M8.5 9.167a3.333 3.333 0 1 0 0-6.667 3.333 3.333 0 0 0 0 6.667z" | ||
stroke="#000" | ||
strokeWidth="2" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
/> | ||
<path | ||
d="M20.166 17.5v-1.667a3.333 3.333 0 0 0-2.5-3.225M14.334 2.608a3.333 3.333 0 0 1 0 6.459M20 3l5 5M25 3l-5 5" | ||
stroke="#000" | ||
strokeWidth="2" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
/> | ||
</svg> | ||
) | ||
|
||
export default NonCompliant |
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,76 @@ | ||
/* eslint camelcase: 0 */ | ||
import React, { memo } from 'react' | ||
import { makeStyles } from '@mui/styles' | ||
import { useTranslation } from 'react-i18next' | ||
import Typography from '@mui/material/Typography' | ||
import moment from 'moment' | ||
|
||
import { eosConfig } from '../../config' | ||
import { formatWithThousandSeparator } from '../../utils' | ||
import VisitSite from 'components/VisitSite' | ||
|
||
import styles from './styles' | ||
|
||
const useStyles = makeStyles(styles) | ||
|
||
const NonCompliantCard = ({ producer, stats }) => { | ||
const classes = useStyles() | ||
const { t } = useTranslation('producerCardComponent') | ||
|
||
const RowInfo = ({ title, value }) => { | ||
return ( | ||
<div className={classes.flex}> | ||
<Typography variant="body1" className={classes.bold}> | ||
{title}: | ||
</Typography> | ||
<Typography variant="body1">{value}</Typography> | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<> | ||
<div className={`${classes.content} ${classes.account}`}> | ||
<Typography variant="h3">{producer.owner}</Typography> | ||
<Typography variant="body1">{t('noInfo')}</Typography> | ||
</div> | ||
<div className={`${classes.content} ${classes.borderLine}`}> | ||
<Typography variant="overline">{t('info')}</Typography> | ||
<div className={classes.flex}> | ||
<Typography variant="body1" className={classes.bold}> | ||
{t('website')}: | ||
</Typography> | ||
<VisitSite title={t('openLink')} url={producer.url} /> | ||
</div> | ||
<RowInfo | ||
title={`${t('votes')}`} | ||
value={`${formatWithThousandSeparator(producer.total_votes_eos, 0)}`} | ||
/> | ||
<RowInfo | ||
title={`${t('lastClaimTime')}`} | ||
value={`${moment(producer.last_claim_time).format('ll')}`} | ||
/> | ||
</div> | ||
<div | ||
className={`${classes.content} ${classes.borderLine} ${classes.hideRewards}`} | ||
> | ||
<Typography variant="overline">{t('dailyRewards')}</Typography> | ||
<RowInfo | ||
title={`${t('rewards')} (USD)`} | ||
value={`$${formatWithThousandSeparator( | ||
producer.total_rewards * stats.tokenPrice, | ||
0, | ||
)}`} | ||
/> | ||
<RowInfo | ||
title={`${t('rewards')} (${eosConfig.tokenSymbol})`} | ||
value={`${formatWithThousandSeparator(producer.total_rewards, 0)}`} | ||
/> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
NonCompliantCard.propTypes = {} | ||
|
||
export default memo(NonCompliantCard) |
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,49 @@ | ||
export default (theme) => ({ | ||
flex: { | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
}, | ||
bold: { | ||
fontWeight: 'bold !important', | ||
}, | ||
account: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
alignSelf: 'center', | ||
[theme.breakpoints.down('sm')]: { | ||
borderBottom: '1px solid rgba(0, 0, 0, 0.2)', | ||
}, | ||
}, | ||
content: { | ||
width: '250px', | ||
height: 'auto', | ||
margin: '0px', | ||
flexGrow: '1', | ||
[theme.breakpoints.down('lg')]: { | ||
width: '150px', | ||
}, | ||
[theme.breakpoints.down('sm')]: { | ||
width: '100%', | ||
}, | ||
}, | ||
borderLine: { | ||
[theme.breakpoints.up('sm')]: { | ||
marginTop: theme.spacing(3), | ||
marginBottom: theme.spacing(3), | ||
borderLeft: '1px solid rgba(0, 0, 0, 0.2)', | ||
padding: theme.spacing(0, 3, 0), | ||
}, | ||
[theme.breakpoints.down('sm')]: { | ||
marginLeft: theme.spacing(3), | ||
}, | ||
}, | ||
hideRewards: { | ||
[theme.breakpoints.down('sm')]: { | ||
'& .MuiTypography-overline': { | ||
display: 'none', | ||
}, | ||
}, | ||
}, | ||
}) |
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,65 @@ | ||
/* eslint camelcase: 0 */ | ||
import React, { memo } from 'react' | ||
import { makeStyles } from '@mui/styles' | ||
import { useTranslation } from 'react-i18next' | ||
import Typography from '@mui/material/Typography' | ||
|
||
import { eosConfig } from '../../config' | ||
import { formatWithThousandSeparator } from '../../utils' | ||
|
||
import styles from './styles' | ||
|
||
const useStyles = makeStyles(styles) | ||
|
||
const RewardsStats = ({ stats }) => { | ||
const classes = useStyles() | ||
const { t } = useTranslation('rewardsDistributionRoute') | ||
|
||
return ( | ||
<> | ||
<div className={`${classes.cardHeader} ${classes.cardShadow}`}> | ||
<div className={classes.rewardsCards}> | ||
<Typography variant="h6">{t('paidProducers')}</Typography> | ||
<Typography variant="h3" className={classes.statsText}> | ||
{stats.quantity || 0} | ||
</Typography> | ||
</div> | ||
</div> | ||
<div className={`${classes.cardHeader} ${classes.cardShadow}`}> | ||
<div className={classes.rewardsCards}> | ||
<Typography variant="h6">{`${t('dailyRewards')} (USD)`}</Typography> | ||
<Typography variant="h3" className={classes.statsText}> | ||
{`${formatWithThousandSeparator( | ||
stats.dailyRewards * stats.tokenPrice, | ||
0, | ||
)} USD`} | ||
</Typography> | ||
</div> | ||
</div> | ||
<div className={`${classes.cardHeader} ${classes.cardShadow}`}> | ||
<div className={classes.rewardsCards}> | ||
<Typography variant="h6"> | ||
{`${t('dailyRewards')} (${eosConfig.tokenSymbol})`} | ||
</Typography> | ||
<Typography variant="h3" className={classes.statsText}> | ||
{`${formatWithThousandSeparator(stats.dailyRewards, 0)} ${ | ||
eosConfig.tokenSymbol | ||
}`} | ||
</Typography> | ||
</div> | ||
</div> | ||
<div className={`${classes.cardHeader} ${classes.cardShadow}`}> | ||
<div className={classes.rewardsCards}> | ||
<Typography variant="h6">{t('rewardsPercentage')}</Typography> | ||
<Typography variant="h3" className={classes.statsText}> | ||
{`${stats.percentageRewards?.toFixed(2)}%`} | ||
</Typography> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
RewardsStats.propTypes = {} | ||
|
||
export default memo(RewardsStats) |
Oops, something went wrong.