mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
#23 lab doesn't require superpowers now
This commit is contained in:
parent
8a9a9b9104
commit
998a2e305a
3 changed files with 42 additions and 30 deletions
15
src/components/containers/Authorized/index.tsx
Normal file
15
src/components/containers/Authorized/index.tsx
Normal file
|
@ -0,0 +1,15 @@
|
|||
import React, { FC } from 'react';
|
||||
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
|
||||
import { selectUser } from '~/redux/auth/selectors';
|
||||
|
||||
interface IProps {}
|
||||
|
||||
const Authorized: FC<IProps> = ({ children }) => {
|
||||
const user = useShallowSelect(selectUser);
|
||||
|
||||
if (!user.is_user) return null;
|
||||
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
||||
export { Authorized };
|
Loading…
Add table
Add a link
Reference in a new issue