Add category page

This commit is contained in:
Hazem Krimi
2021-05-12 01:40:36 +01:00
parent 602e3101d5
commit 2ad4aba796
2 changed files with 46 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { useReactiveVar } from '@apollo/client';
import { Redirect } from 'react-router';
import { roleVar } from '../../graphql/state';
import { Empty } from '../../assets';
import { Box } from '../../components';
import { Wrapper } from './styles';
const Category = () => {
const role = useReactiveVar(roleVar);
return role === 'developer' ? (
<Wrapper color={role}>
<Box
width='100%'
height='100vh'
display='grid'
alignItems='center'
justifyContent='center'
>
<Box>
<Empty />
</Box>
</Box>
</Wrapper>
) : (
<>
{role === 'admin' && <Redirect to='/clients' />}
{role === 'client' ||
(role === 'productOwner' && <Redirect to='/project' />)}
</>
);
};
export default Category;
+12
View File
@@ -0,0 +1,12 @@
import styled from 'styled-components';
type WrapperProps = {
color?: 'client' | 'productOwner' | 'developer' | 'admin';
};
export const Wrapper = styled.div<WrapperProps>`
.empty {
fill: ${({ theme, color }) =>
color ? theme.colors[color].main : theme.colors.client.main};
}
`;