mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-25 03:09:32 -06:00
add standard container component
This commit is contained in:
52
src/Components/StandardContainer/index.jsx
Normal file
52
src/Components/StandardContainer/index.jsx
Normal file
@@ -0,0 +1,52 @@
|
||||
// Components
|
||||
import { Stack } from "@mui/material";
|
||||
|
||||
// Utils
|
||||
import { useTheme } from "@emotion/react";
|
||||
|
||||
const Container = ({ children, direction, backgroundColor, sx }) => {
|
||||
const theme = useTheme();
|
||||
let bgColor =
|
||||
typeof backgroundColor !== "undefined"
|
||||
? backgroundColor
|
||||
: theme.palette.background.main;
|
||||
return (
|
||||
<Stack
|
||||
direction={direction}
|
||||
padding={theme.spacing(8)}
|
||||
gap={theme.spacing(2)}
|
||||
border={1}
|
||||
borderColor={theme.palette.primary.lowContrast}
|
||||
borderStyle="solid"
|
||||
borderRadius={theme.spacing(4)}
|
||||
backgroundColor={bgColor}
|
||||
sx={{ ...sx }}
|
||||
>
|
||||
{children}
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
export const ColContainer = ({ children, backgroundColor, sx }) => {
|
||||
return (
|
||||
<Container
|
||||
direction="column"
|
||||
backgroundColor={backgroundColor}
|
||||
sx={{ ...sx }}
|
||||
>
|
||||
{children}
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
||||
export const RowContainer = ({ children, backgroundColor, sx }) => {
|
||||
return (
|
||||
<Container
|
||||
direction="row"
|
||||
backgroundColor={backgroundColor}
|
||||
sx={{ ...sx }}
|
||||
>
|
||||
{children}
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user