refactor: rename table cell component
This commit is contained in:
parent
a93f56cdc7
commit
4b5ca48190
1 changed files with 9 additions and 9 deletions
|
|
@ -15,7 +15,7 @@ import { H4, Label2, P, Info2 } from 'src/components/typography'
|
||||||
import styles from './Assets.styles'
|
import styles from './Assets.styles'
|
||||||
const useStyles = makeStyles(styles)
|
const useStyles = makeStyles(styles)
|
||||||
|
|
||||||
const StyledCell = withStyles({
|
const Cell = withStyles({
|
||||||
root: {
|
root: {
|
||||||
borderBottom: '4px solid white',
|
borderBottom: '4px solid white',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
|
|
@ -67,27 +67,27 @@ const AssetsAmountTable = ({ title, data = [], numToRender }) => {
|
||||||
if (idx < numToRender) {
|
if (idx < numToRender) {
|
||||||
return (
|
return (
|
||||||
<TableRow className={classes.row} key={idx}>
|
<TableRow className={classes.row} key={idx}>
|
||||||
<StyledCell align="left">
|
<Cell align="left">
|
||||||
<P>{asset.display}</P>
|
<P>{asset.display}</P>
|
||||||
</StyledCell>
|
</Cell>
|
||||||
<StyledCell align="right">
|
<Cell align="right">
|
||||||
<P>{`${selectAmountPrefix(asset)}
|
<P>{`${selectAmountPrefix(asset)}
|
||||||
${formatCurrency(Math.abs(asset.amount))} ${
|
${formatCurrency(Math.abs(asset.amount))} ${
|
||||||
asset.currency
|
asset.currency
|
||||||
}`}</P>
|
}`}</P>
|
||||||
</StyledCell>
|
</Cell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
})}
|
})}
|
||||||
<TableRow className={classes.totalRow} key={data?.length + 1}>
|
<TableRow className={classes.totalRow} key={data?.length + 1}>
|
||||||
<StyledCell align="left">
|
<Cell align="left">
|
||||||
<Info2>{`Total ${R.toLower(title)}`}</Info2>
|
<Info2>{`Total ${R.toLower(title)}`}</Info2>
|
||||||
</StyledCell>
|
</Cell>
|
||||||
<StyledCell align="right">
|
<Cell align="right">
|
||||||
<Info2>{`${formatCurrency(totalAmount)} ${currency}`}</Info2>
|
<Info2>{`${formatCurrency(totalAmount)} ${currency}`}</Info2>
|
||||||
</StyledCell>
|
</Cell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue