-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use header tags more often and at right places
- Loading branch information
1 parent
3912418
commit 3c14564
Showing
4 changed files
with
51 additions
and
52 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
33 changes: 33 additions & 0 deletions
33
packages/frontend/src/components/Strategies/PerformanceMetric.tsx
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,33 @@ | ||
import React from 'react' | ||
import { Box, Typography } from '@material-ui/core' | ||
import clsx from 'clsx' | ||
|
||
import useStyles from './styles' | ||
import { formatNumber } from '@utils/formatter' | ||
|
||
const PerformanceMetric: React.FC<{ label: string; value: number }> = ({ label, value }) => { | ||
const classes = useStyles() | ||
|
||
return ( | ||
<Box display="flex" justifyContent="flex-end" alignItems="center" gridGap="6px"> | ||
<Typography variant="h4" className={classes.textSmall}> | ||
{label} | ||
</Typography> | ||
|
||
<Box minWidth="6ch" display="flex" justifyContent="flex-end"> | ||
<Typography | ||
className={clsx( | ||
classes.textSmall, | ||
classes.textMonospace, | ||
value >= 0 ? classes.colorSuccess : classes.colorError, | ||
)} | ||
> | ||
{value >= 0 && '+'} | ||
{formatNumber(value)}% | ||
</Typography> | ||
</Box> | ||
</Box> | ||
) | ||
} | ||
|
||
export default PerformanceMetric |