Refactor, update UI, and add notes
This commit is contained in:
+13
-6
@@ -8,16 +8,23 @@ type LayoutProps = {
|
||||
title?: string,
|
||||
ancestors?: Array<{ name: string, path: string }>
|
||||
children?: ChildrenType,
|
||||
removeContainer?: boolean,
|
||||
};
|
||||
|
||||
function Layout({ name, title, children, ancestors }: LayoutProps) {
|
||||
function Container(props: {children?: ChildrenType, ignore?: boolean}) {
|
||||
if (props.ignore)
|
||||
return <>{props.children}</>;
|
||||
return <div className='container'>
|
||||
{props.children}
|
||||
</div>;
|
||||
}
|
||||
|
||||
function Layout(props : LayoutProps) {
|
||||
return (
|
||||
<>
|
||||
<Meta name={name} ancestors={ancestors} />
|
||||
<Title title={title} name={name} ancestors={ancestors} />
|
||||
<div className='container'>
|
||||
{children}
|
||||
</div>
|
||||
<Meta name={props.name} ancestors={props.ancestors} />
|
||||
<Title title={props.title} name={props.name} ancestors={props.ancestors} />
|
||||
<Container ignore={props.removeContainer}>{props.children}</Container>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user