1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

#23 fixed submit button appearance for lab

This commit is contained in:
Fedor Katurov 2021-03-26 12:35:31 +07:00
parent 998a2e305a
commit ede5dfe17f
15 changed files with 82 additions and 44 deletions

View file

@ -1,17 +1,30 @@
import React, { FC } from 'react';
import { createPortal } from 'react-dom';
import { Route, Switch } from 'react-router';
import { TagSidebar } from '~/containers/sidebars/TagSidebar';
import { ProfileSidebar } from '~/containers/sidebars/ProfileSidebar';
import { Authorized } from '~/components/containers/Authorized';
import { SubmitBar } from '~/components/bars/SubmitBar';
interface IProps {
prefix?: string;
isLab?: boolean;
}
const SidebarRouter: FC<IProps> = ({ prefix = '' }) => (
<Switch>
<Route path={`${prefix}/tag/:tag`} component={TagSidebar} />
<Route path={`${prefix}/~:username`} component={ProfileSidebar} />
</Switch>
);
const SidebarRouter: FC<IProps> = ({ prefix = '', isLab }) => {
return createPortal(
<>
<Switch>
<Route path={`${prefix}/tag/:tag`} component={TagSidebar} />
<Route path={`${prefix}/~:username`} component={ProfileSidebar} />
</Switch>
<Authorized>
<SubmitBar isLab={isLab} />
</Authorized>
</>,
document.body
);
};
export { SidebarRouter };