mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
made nextjs-ready config
This commit is contained in:
parent
28b8242b4d
commit
8bac6bb2f7
8 changed files with 45 additions and 40 deletions
|
@ -1,12 +1,14 @@
|
|||
import * as React from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import { Header } from '~/containers/main/Header';
|
||||
import { SidebarRouter } from '~/containers/main/SidebarRouter';
|
||||
|
||||
export const MainLayout = ({ children }) => (
|
||||
<div className={styles.wrapper}>
|
||||
<div className={styles.content}>
|
||||
<Header />
|
||||
{children}
|
||||
<SidebarRouter />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import React, { FC } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { Authorized } from '~/components/containers/Authorized';
|
||||
import { SubmitBar } from '~/components/bars/SubmitBar';
|
||||
|
||||
|
@ -8,17 +7,10 @@ interface IProps {
|
|||
isLab?: boolean;
|
||||
}
|
||||
|
||||
const SidebarRouter: FC<IProps> = ({ isLab }) => {
|
||||
if (typeof document === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return createPortal(
|
||||
<Authorized>
|
||||
<SubmitBar isLab={isLab} />
|
||||
</Authorized>,
|
||||
document.body
|
||||
);
|
||||
};
|
||||
const SidebarRouter: FC<IProps> = ({ isLab }) => (
|
||||
<Authorized>
|
||||
<SubmitBar isLab={isLab} />
|
||||
</Authorized>
|
||||
);
|
||||
|
||||
export { SidebarRouter };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue