feat: add custom Container component for layouts
This commit is contained in:
parent
2cd851a7c1
commit
e54eced800
24
src/components/Container/index.tsx
Normal file
24
src/components/Container/index.tsx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { CSSProperties, PropsWithChildren } from 'react'
|
||||||
|
import defaultStyle from './style.module.scss'
|
||||||
|
|
||||||
|
interface ContainerProps {
|
||||||
|
style?: CSSProperties
|
||||||
|
className?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Container = ({
|
||||||
|
style = {},
|
||||||
|
className = '',
|
||||||
|
children
|
||||||
|
}: PropsWithChildren<ContainerProps>) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
...style
|
||||||
|
}}
|
||||||
|
className={`${defaultStyle.container} ${className}`}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
6
src/components/Container/style.module.scss
Normal file
6
src/components/Container/style.module.scss
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 1400px;
|
||||||
|
padding-inline: 10px;
|
||||||
|
margin-inline: auto;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user