|
|
|
@ -1,9 +1,10 @@ |
|
|
|
|
import { Grid as MUIGrid } from '@mui/material'; |
|
|
|
|
import { Box as MUIBox, Grid as MUIGrid } from '@mui/material'; |
|
|
|
|
import { FC, useMemo } from 'react'; |
|
|
|
|
|
|
|
|
|
const Grid: FC<GridProps> = ({ |
|
|
|
|
calculateItemBreakpoints = () => ({ xs: 1 }), |
|
|
|
|
layout, |
|
|
|
|
wrapperBoxProps, |
|
|
|
|
...restGridProps |
|
|
|
|
}) => { |
|
|
|
|
const itemElements = useMemo(() => { |
|
|
|
@ -24,9 +25,12 @@ const Grid: FC<GridProps> = ({ |
|
|
|
|
}, [calculateItemBreakpoints, layout]); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
// Make Grid compatible with FlexBox by adding an extra empty wrapper.
|
|
|
|
|
<MUIBox {...wrapperBoxProps}> |
|
|
|
|
<MUIGrid container {...restGridProps}> |
|
|
|
|
{itemElements} |
|
|
|
|
</MUIGrid> |
|
|
|
|
</MUIBox> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|