refactor: remove unnecessary Grid and use Anvil component in list

main
Josue 4 years ago committed by Tsu-ba-me
parent b496e8b847
commit b72dacb61f
  1. 5
      striker-ui/components/Anvils/Anvil.tsx
  2. 5
      striker-ui/components/Anvils/AnvilList.tsx

@ -1,12 +1,11 @@
import { Grid } from '@material-ui/core';
import { BodyText } from '../Text'; import { BodyText } from '../Text';
const Anvil = ({ anvil }: { anvil: AnvilListItem }): JSX.Element => { const Anvil = ({ anvil }: { anvil: AnvilListItem }): JSX.Element => {
return ( return (
<Grid item xs={12}> <>
<BodyText text={anvil.anvil_name} /> <BodyText text={anvil.anvil_name} />
<BodyText text={anvil.anvil_state || 'State unavailable'} /> <BodyText text={anvil.anvil_state || 'State unavailable'} />
</Grid> </>
); );
}; };

@ -1,8 +1,8 @@
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { ClassNameMap } from '@material-ui/styles'; import { ClassNameMap } from '@material-ui/styles';
import { List, Box, Divider, ListItem } from '@material-ui/core'; import { List, Box, Divider, ListItem } from '@material-ui/core';
import { BodyText } from '../Text';
import { BLUE, PURPLE_OFF, RED_ON, TEXT } from '../../lib/consts/DEFAULT_THEME'; import { BLUE, PURPLE_OFF, RED_ON, TEXT } from '../../lib/consts/DEFAULT_THEME';
import Anvil from './Anvil';
const useStyles = makeStyles(() => ({ const useStyles = makeStyles(() => ({
root: { root: {
@ -73,8 +73,7 @@ const AnvilList = ({ list }: { list: AnvilListItem[] }): JSX.Element => {
/> />
</Box> </Box>
<Box p={1} flexGrow={1} className={classes.anvil}> <Box p={1} flexGrow={1} className={classes.anvil}>
<BodyText text={anvil?.anvil_name} /> <Anvil anvil={anvil} />
<BodyText text={anvil?.anvil_state || 'State unavailable'} />
</Box> </Box>
</Box> </Box>
</ListItem> </ListItem>

Loading…
Cancel
Save