mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
removed redux completely
This commit is contained in:
parent
26e6d8d41b
commit
a4bb07e9cf
323 changed files with 2464 additions and 3348 deletions
|
@ -1,13 +1,12 @@
|
|||
import React, { FC } from "react";
|
||||
import { useShallowSelect } from "~/hooks/data/useShallowSelect";
|
||||
import { selectUser } from "~/redux/auth/selectors";
|
||||
import React, { FC } from 'react';
|
||||
import { useAuth } from '~/hooks/auth/useAuth';
|
||||
|
||||
interface IProps {}
|
||||
|
||||
const Authorized: FC<IProps> = ({ children }) => {
|
||||
const user = useShallowSelect(selectUser);
|
||||
const { isUser } = useAuth();
|
||||
|
||||
if (!user.is_user) return null;
|
||||
if (!isUser) return null;
|
||||
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue