Edited container - wideclass condition has been added

This commit is contained in:
“Salar 2022-08-30 16:19:43 +03:00
parent eb7205025c
commit ace9e7498d

View File

@ -5,19 +5,24 @@ type Props = {
* Content of component
*/
children: React.ReactNode;
/**
* Display variants of container
*/
variant?: "straight" | "wide";
/**
* Component styling
*/
className?: string;
} & Omit<React.ComponentPropsWithoutRef<"div">, "">
};
/**
* Main container to handle page content max-width on
* different screen sizes
*/
export default function Container({children, className}: Props) {
export default function Container({ children, variant, className }: Props) {
const wideClass = variant == "straight" ? "container" : "container-wide";
return (
<div className={ classNames('container mx-auto', className) }>
<div className={classNames("mx-auto", wideClass, className)}>
{children}
</div>
)
);
}