www/components/layout.tsx

28 lines
596 B
TypeScript
Raw Normal View History

2021-12-08 03:38:31 +00:00
import Title from './title';
2022-04-28 01:55:18 +00:00
type ChildrenType = JSX.Element | Array<ChildrenType>;
type LayoutProps = {
children?: ChildrenType,
2022-10-05 03:41:59 +00:00
removeContainer?: boolean,
2021-12-08 03:38:31 +00:00
};
2022-10-05 03:41:59 +00:00
function Container(props: {children?: ChildrenType, ignore?: boolean}) {
if (props.ignore)
return <>{props.children}</>;
return <div className='container'>
{props.children}
</div>;
}
function Layout(props : LayoutProps) {
2021-12-08 03:38:31 +00:00
return (
<>
<Title />
2022-10-05 03:41:59 +00:00
<Container ignore={props.removeContainer}>{props.children}</Container>
2021-12-08 03:38:31 +00:00
</>
);
}
export default Layout;