Merge pull request #669 from chaotixkilla/feat-dashboard-machine-nav-button

Arrow button to navigate to machine page on dashboard
This commit is contained in:
Rafael Taranto 2021-04-30 17:57:44 +01:00 committed by GitHub
commit acaa7e9390
2 changed files with 20 additions and 2 deletions

View file

@ -13,6 +13,7 @@ import { Status } from 'src/components/Status'
import { Label2, TL2 } from 'src/components/typography' import { Label2, TL2 } from 'src/components/typography'
// import { ReactComponent as TxInIcon } from 'src/styling/icons/direction/cash-in.svg' // import { ReactComponent as TxInIcon } from 'src/styling/icons/direction/cash-in.svg'
import { ReactComponent as TxOutIcon } from 'src/styling/icons/direction/cash-out.svg' import { ReactComponent as TxOutIcon } from 'src/styling/icons/direction/cash-out.svg'
import { ReactComponent as MachineLinkIcon } from 'src/styling/icons/month arrows/right.svg'
import styles from './MachinesTable.styles' import styles from './MachinesTable.styles'
@ -99,10 +100,19 @@ const MachinesTable = ({ machines, numToRender }) => {
return ( return (
<TableRow <TableRow
onClick={() => redirect(machine)} onClick={() => redirect(machine)}
className={classnames(classes.row, classes.clickableRow)} className={classnames(classes.row)}
key={machine.deviceId + idx}> key={machine.deviceId + idx}>
<StyledCell align="left"> <StyledCell
align="left"
className={classes.machineNameWrapper}>
<TL2>{machine.name}</TL2> <TL2>{machine.name}</TL2>
<MachineLinkIcon
className={classnames(
classes.machineRedirectIcon,
classes.clickableRow
)}
onClick={() => redirect(machine)}
/>
</StyledCell> </StyledCell>
<StyledCell> <StyledCell>
<Status status={machine.statuses[0]} /> <Status status={machine.statuses[0]} />

View file

@ -87,6 +87,14 @@ const styles = {
marginBottom: 0, marginBottom: 0,
padding: 0, padding: 0,
textAlign: 'center' textAlign: 'center'
},
machineNameWrapper: {
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
},
machineRedirectIcon: {
marginLeft: 10
} }
} }