Skip to content

Commit

Permalink
feat: my projects ui stub (#8185)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Sep 19, 2024
1 parent 29b292f commit 70e95e6
Showing 1 changed file with 137 additions and 1 deletion.
138 changes: 137 additions & 1 deletion frontend/src/component/personalDashboard/PersonalDashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,139 @@
import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser';
import {
Grid,
Paper,
styled,
Typography,
Box,
List,
ListItem,
ListItemButton,
} from '@mui/material';
import type { Theme } from '@mui/material/styles/createTheme';
import { ProjectIcon } from 'component/common/ProjectIcon/ProjectIcon';

const ScreenExplanation = styled(Typography)(({ theme }) => ({
marginTop: theme.spacing(1),
marginBottom: theme.spacing(8),
maxWidth: theme.spacing(45),
}));

const StyledHeaderTitle = styled(Typography)(({ theme }) => ({
fontSize: theme.typography.h2.fontSize,
fontWeight: 'normal',
marginBottom: theme.spacing(2),
}));

const Projects = styled(Paper)(({ theme }) => ({
borderRadius: `${theme.shape.borderRadiusLarge}px`,
boxShadow: 'none',
padding: theme.spacing(4),
}));

const projectStyle = (theme: Theme) => ({
borderRadius: theme.spacing(0.5),
borderLeft: `${theme.spacing(0.5)} solid transparent`,
'&.Mui-selected': {
borderLeft: `${theme.spacing(0.5)} solid ${theme.palette.primary.main}`,
},
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
gap: theme.spacing(1),
});

export const PersonalDashboard = () => {
return <>Personal Dashboard</>;
const { user } = useAuthUser();

const name = user?.name;

return (
<div>
<Typography component='h2' variant='h2'>
Welcome {name}
</Typography>
<ScreenExplanation>
Here are some tasks we think would be useful in order to get the
most of Unleash
</ScreenExplanation>
<StyledHeaderTitle>Your resources</StyledHeaderTitle>
<Projects>
<Grid container spacing={2} columns={{ lg: 12 }}>
<Grid item lg={3}>
<Typography variant='h3'>My projects</Typography>
</Grid>
<Grid item lg={4} />
<Grid item lg={5} />
<Grid item lg={3}>
<List disablePadding={true}>
<ListItem disablePadding={true}>
<ListItemButton
sx={projectStyle}
selected={true}
>
<Box sx={{ display: 'flex', gap: 2 }}>
<ProjectIcon color='primary' /> Default
</Box>
<Box sx={{ display: 'flex', gap: 2 }}>
<Box>
<Typography
variant='subtitle2'
color='primary'
>
0
</Typography>
<Typography
variant='caption'
color='text.secondary'
>
flags
</Typography>
</Box>
<Box>
<Typography
variant='subtitle2'
color='primary'
>
1
</Typography>
<Typography
variant='caption'
color='text.secondary'
>
members
</Typography>
</Box>
<Box>
<Typography
variant='subtitle2'
color='primary'
>
100%
</Typography>
<Typography
variant='caption'
color='text.secondary'
>
health
</Typography>
</Box>
</Box>
</ListItemButton>
</ListItem>
</List>
</Grid>
<Grid item lg={4}>
Connect an SDK
</Grid>
<Grid item lg={5}>
Create a feature toggle
</Grid>
<Grid item lg={3} />
<Grid item lg={9}>
Your role in this project
</Grid>
</Grid>
</Projects>
</div>
);
};

0 comments on commit 70e95e6

Please sign in to comment.