Skip to content

Commit 7a49b74

Browse files
committed
refactor(tsx): refactor GridItem
1 parent 440b5d2 commit 7a49b74

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/ui/components/Grid/GridItem.tsx

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
11
import React, { ReactNode } from 'react';
2-
import PropTypes from 'prop-types';
3-
import { makeStyles } from '@material-ui/core/styles';
2+
import { makeStyles, Theme } from '@material-ui/core/styles';
43
import Grid, { GridProps } from '@material-ui/core/Grid';
54

6-
const styles = {
5+
const useStyles = makeStyles((theme: Theme) => ({
76
grid: {
87
padding: '0 15px !important',
98
},
10-
};
11-
12-
const useStyles = makeStyles(styles);
9+
}));
1310

14-
interface GridItemProps extends GridProps {
11+
export interface GridItemProps extends GridProps {
1512
children?: ReactNode;
1613
}
1714

18-
export default function GridItem(props: GridItemProps) {
15+
const GridItem: React.FC<GridItemProps> = ({ children, ...rest }) => {
1916
const classes = useStyles();
20-
const { children, ...rest } = props;
2117
return (
2218
<Grid item {...rest} className={classes.grid}>
2319
{children}
2420
</Grid>
2521
);
26-
}
27-
28-
GridItem.propTypes = {
29-
children: PropTypes.node,
3022
};
23+
24+
export default GridItem;

0 commit comments

Comments
 (0)