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

#23 added superpowers switch

This commit is contained in:
Fedor Katurov 2021-03-19 14:15:04 +07:00
parent e38090c755
commit 756840f173
16 changed files with 178 additions and 25 deletions

View file

@ -0,0 +1,16 @@
import React, { FC, memo } from 'react';
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
import { selectAuthIsTester, selectUser } from '~/redux/auth/selectors';
interface IProps {}
const Superpower: FC<IProps> = memo(({ children }) => {
const user = useShallowSelect(selectUser);
const is_tester = useShallowSelect(selectAuthIsTester);
if (!user || !is_tester) return null;
return <>{children}</>;
});
export { Superpower };