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