Skip to content

Commit

Permalink
Moved Charts to Cards on Home page
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Jud committed May 17, 2024
1 parent d8681ac commit 3ed8b33
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 231 deletions.
56 changes: 0 additions & 56 deletions src/components/Charts.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import MainContainer from './common/MainContainer';

const HomePage = () => {
const loggedIn = useAppSelector((state) => state.auth.loggedIn);
const UserHomePage = lazy(() => import('./UserHomePage'));
const UserHomePage = lazy(() => import('./home/UserHomePage'));
const UnautheticatedHomePage = lazy(() => import('./UnautheticatedHomePage'));

return (
Expand Down
134 changes: 0 additions & 134 deletions src/components/UserHomePage.tsx

This file was deleted.

32 changes: 0 additions & 32 deletions src/components/VacationGauge.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Card, CardContent, Stack, SvgIconTypeMap, Typography } from '@mui/material';
import { OverridableComponent } from '@mui/material/OverridableComponent';
import { PropsWithChildren } from 'react';

interface UserHomePageInfoCardPropertioes {
interface HomeCardPropertioes {
title: string;
value: string;
subtitle: string;
SvgIcon: OverridableComponent<SvgIconTypeMap>;
}

const UserHomePageInfoCard = ({ title, value, subtitle, SvgIcon }: UserHomePageInfoCardPropertioes) => {
const HomeCard = ({ title, subtitle, SvgIcon, children }: PropsWithChildren<HomeCardPropertioes>) => {
return (
<Card sx={{ minWidth: 256 }}>
<Card sx={{ width: '100%', overflow: 'hidden' }}>
<CardContent>
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start" gap={2} width="100%">
<Stack direction="row" justifyContent="space-between" alignItems="flex-start" gap={2} width="100%">
Expand All @@ -20,9 +20,8 @@ const UserHomePageInfoCard = ({ title, value, subtitle, SvgIcon }: UserHomePageI
<SvgIcon color="secondary" />
</Stack>

<Typography variant="h4" color="text.primary">
{value}
</Typography>
{children}

<Typography variant="body2" color="text.disabled">
{subtitle}
</Typography>
Expand All @@ -32,4 +31,4 @@ const UserHomePageInfoCard = ({ title, value, subtitle, SvgIcon }: UserHomePageI
);
};

export default UserHomePageInfoCard;
export default HomeCard;
Loading

0 comments on commit 3ed8b33

Please sign in to comment.