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

View File

@ -196,7 +196,9 @@ const StatsRoot: React.FC<any> = () => {
tvl.data.forEach((val) => {
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]);
@ -250,15 +252,15 @@ const StatsRoot: React.FC<any> = () => {
)}
</>
</Paper>
<Paper className={classes.mainPaper}>
<NFTStats />
</Paper>
<Paper className={classes.mainPaper}>
<TransactionMetrics />
</Paper>
<Paper className={classes.mainPaper}>
<CustodyAddresses />
</Paper>
<Paper className={classes.mainPaper}>
<NFTStats />
</Paper>
</Container>
);
};