1
0
Fork 0
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:
Fedor Katurov 2022-01-13 12:37:15 +07:00
parent 28b8242b4d
commit 8bac6bb2f7
8 changed files with 45 additions and 40 deletions

View file

@ -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>
);

View file

@ -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 };