revamp template
This commit is contained in:
25
src/components/container/Container.tsx
Normal file
25
src/components/container/Container.tsx
Normal file
@ -0,0 +1,25 @@
|
||||
import clsx from 'clsx';
|
||||
import { type ReactNode } from 'react';
|
||||
|
||||
import { useSettings } from '../../providers/SettingsProvider';
|
||||
import { TSettingsContainer } from '@/config';
|
||||
|
||||
export interface TPageContainerProps {
|
||||
children?: ReactNode;
|
||||
width?: TSettingsContainer;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const Container = ({ children, width, className = '' }: TPageContainerProps) => {
|
||||
const { settings } = useSettings();
|
||||
const { container } = settings;
|
||||
const widthMode = width ?? container;
|
||||
|
||||
return (
|
||||
<div className={clsx(className, widthMode === 'fixed' ? 'container-fixed' : 'container-fluid')}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { Container };
|
||||
1
src/components/container/index.ts
Normal file
1
src/components/container/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './Container';
|
||||
Reference in New Issue
Block a user