-
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.
- Loading branch information
Showing
55 changed files
with
964 additions
and
305 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,5 @@ export { | |
EndpointSvg, | ||
MissingBlocksSvg, | ||
TopologySvg, | ||
RewardsSvg | ||
RewardsSvg, | ||
} |
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,83 @@ | ||
/* 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 isUrlValid from '../../utils/validate-url' | ||
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" component="span"> | ||
{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> | ||
{isUrlValid(producer.url) ? ( | ||
<VisitSite title={t('openLink')} url={producer.url} /> | ||
) : ( | ||
<Typography variant="body1">{t('invalidUrl')}</Typography> | ||
)} | ||
</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', | ||
}, | ||
}, | ||
}, | ||
}) |
Oops, something went wrong.