Update project page

This commit is contained in:
Hazem Krimi
2021-05-06 01:44:14 +01:00
parent e428255bd4
commit 46130c0f88
+4 -1
View File
@@ -1,4 +1,5 @@
import { useReactiveVar } from '@apollo/client'; import { useReactiveVar } from '@apollo/client';
import { Redirect } from 'react-router';
import { roleVar } from '../../graphql/state'; import { roleVar } from '../../graphql/state';
import { Empty } from '../../assets'; import { Empty } from '../../assets';
import { Box } from '../../components'; import { Box } from '../../components';
@@ -7,7 +8,7 @@ import { Wrapper } from './styles';
const Project = () => { const Project = () => {
const role = useReactiveVar(roleVar); const role = useReactiveVar(roleVar);
return ( return role !== 'admin' ? (
<Wrapper color={role}> <Wrapper color={role}>
<Box <Box
width='100%' width='100%'
@@ -21,6 +22,8 @@ const Project = () => {
</Box> </Box>
</Box> </Box>
</Wrapper> </Wrapper>
) : (
<Redirect to='/clients' />
); );
}; };