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:
parent
e38090c755
commit
756840f173
16 changed files with 178 additions and 25 deletions
16
src/components/boris/Superpower/index.tsx
Normal file
16
src/components/boris/Superpower/index.tsx
Normal 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 };
|
Loading…
Add table
Add a link
Reference in a new issue