|
@@ -3,16 +3,23 @@ import { cn } from '@/lib/utils'
|
|
|
|
|
|
|
|
interface MainProps extends React.HTMLAttributes<HTMLElement> {
|
|
interface MainProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
fixed?: boolean
|
|
fixed?: boolean
|
|
|
|
|
+ fluid?: boolean
|
|
|
ref?: React.Ref<HTMLElement>
|
|
ref?: React.Ref<HTMLElement>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export const Main = ({ fixed, className, ...props }: MainProps) => {
|
|
|
|
|
|
|
+export const Main = ({ fixed, className, fluid, ...props }: MainProps) => {
|
|
|
return (
|
|
return (
|
|
|
<main
|
|
<main
|
|
|
data-layout={fixed ? 'fixed' : 'auto'}
|
|
data-layout={fixed ? 'fixed' : 'auto'}
|
|
|
className={cn(
|
|
className={cn(
|
|
|
'px-4 py-6',
|
|
'px-4 py-6',
|
|
|
|
|
+
|
|
|
|
|
+ // If layout is fixed, make the main container flex and grow
|
|
|
fixed && 'flex grow flex-col overflow-hidden',
|
|
fixed && 'flex grow flex-col overflow-hidden',
|
|
|
|
|
+
|
|
|
|
|
+ // If layout is not fluid, set the max-width
|
|
|
|
|
+ !fluid &&
|
|
|
|
|
+ '@7xl/content:mx-auto @7xl/content:w-full @7xl/content:max-w-7xl',
|
|
|
className
|
|
className
|
|
|
)}
|
|
)}
|
|
|
{...props}
|
|
{...props}
|