crap
This commit is contained in:
20
src/pages/PageWrapper/PageWrapper.tsx
Normal file
20
src/pages/PageWrapper/PageWrapper.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import {FC, ReactNode} from "react";
|
||||
import {Flex} from "@mantine/core";
|
||||
import {Navbar} from "../../components/Navbar/Navbar.tsx";
|
||||
import {useSelector} from "react-redux";
|
||||
import {RootState} from "../../redux/store.ts";
|
||||
|
||||
export type Props = {
|
||||
children: ReactNode;
|
||||
}
|
||||
const PageWrapper: FC<Props> = ({children}) => {
|
||||
const authState = useSelector((state: RootState) => state.auth);
|
||||
return (<Flex style={{flex: 1}}>
|
||||
{authState.isAuthorized &&
|
||||
<Navbar/>
|
||||
}
|
||||
{children}
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
export default PageWrapper;
|
||||
Reference in New Issue
Block a user