mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-02 02:30:29 +00:00
Add category page
This commit is contained in:
@@ -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;
|
||||
@@ -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};
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user