bridge_ui: tvl >1b decimals

This commit is contained in:
Evan Gray 2022-01-03 00:46:11 +00:00 committed by Evan Gray
parent 07446e2e23
commit 9a0b2240d9
2 changed files with 9 additions and 4 deletions

View File

@ -46,6 +46,7 @@ const useStyles = makeStyles((theme) => ({
}, },
totalsBox: { totalsBox: {
display: "flex", display: "flex",
flexWrap: "wrap",
width: "100%", width: "100%",
justifyContent: "space-evenly", justifyContent: "space-evenly",
alignItems: "center", alignItems: "center",
@ -53,6 +54,8 @@ const useStyles = makeStyles((theme) => ({
totalContainer: { totalContainer: {
display: "flex", display: "flex",
alignItems: "flex-end", alignItems: "flex-end",
paddingLeft: theme.spacing(0.5),
paddingRight: theme.spacing(0.5),
paddingBottom: 1, // line up with left text bottom paddingBottom: 1, // line up with left text bottom
[theme.breakpoints.down("sm")]: { [theme.breakpoints.down("sm")]: {
marginTop: theme.spacing(1), marginTop: theme.spacing(1),

View File

@ -196,7 +196,9 @@ const StatsRoot: React.FC<any> = () => {
tvl.data.forEach((val) => { tvl.data.forEach((val) => {
if (val.totalValue) sum += val.totalValue; if (val.totalValue) sum += val.totalValue;
}); });
return numeral(sum).format("0 a").toUpperCase(); return numeral(sum)
.format(sum >= 1000000000 ? "0.000 a" : "0 a")
.toUpperCase();
} }
}, [tvl.data]); }, [tvl.data]);
@ -250,15 +252,15 @@ const StatsRoot: React.FC<any> = () => {
)} )}
</> </>
</Paper> </Paper>
<Paper className={classes.mainPaper}>
<NFTStats />
</Paper>
<Paper className={classes.mainPaper}> <Paper className={classes.mainPaper}>
<TransactionMetrics /> <TransactionMetrics />
</Paper> </Paper>
<Paper className={classes.mainPaper}> <Paper className={classes.mainPaper}>
<CustodyAddresses /> <CustodyAddresses />
</Paper> </Paper>
<Paper className={classes.mainPaper}>
<NFTStats />
</Paper>
</Container> </Container>
); );
}; };