Skip to content

Commit 08db199

Browse files
committed
feature: added organisation dashboard
1 parent 973bf74 commit 08db199

11 files changed

Lines changed: 194 additions & 7 deletions

File tree

Lines changed: 30 additions & 0 deletions
Loading

src/app/not-found.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@ const NotFound: FC = () => {
3030
<br />
3131
Ви можете написати в підтримку, якщо ви впевнені, що виникла помилка
3232
</Typography>
33-
<Button
34-
onClick={() => router.back()}
35-
size={ButtonSize.LARGE}
36-
variant={ButtonVariant.CONTAINED}
37-
color={ButtonColor.PRIMARY}
38-
icon={ButtonIcon.NONE}
39-
>
33+
<Button onClick={() => router.back()} size="large">
4034
Повернутися назад
4135
</Button>
4236
</Box>

src/app/organisations/Organisations.styles.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,12 @@ export const search: SxProps<Theme> = {
1818
export const input: SxProps<Theme> = {
1919
maxWidth: '730px',
2020
flexGrow: 1,
21+
mb: '26px',
22+
};
23+
24+
export const organisations: SxProps<Theme> = {
25+
maxWidth: '994px',
26+
display: 'grid',
27+
gap: '16px',
28+
mb: '64px',
2129
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { SxProps, Theme } from '@mui/material/styles';
2+
3+
export const layout: SxProps<Theme> = {
4+
p: '48px 100px 36px 100px',
5+
display: 'flex',
6+
backgroundColor: 'gray.700',
7+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { SxProps, Theme } from '@mui/material/styles';
2+
3+
export const wrapper: SxProps<Theme> = {
4+
display: 'flex',
5+
alignItems: 'center',
6+
justifyContent: 'flex-start',
7+
gap: '20px',
8+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { FC } from 'react';
2+
import { Box, Typography } from '@mui/material';
3+
4+
import * as styles from './InfoCard.styles';
5+
6+
interface InfoCardProps {
7+
name: string;
8+
value: string;
9+
}
10+
11+
const InfoCard: FC<InfoCardProps> = ({ name, value }) => {
12+
return (
13+
<Box sx={styles.wrapper}>
14+
<Typography color="gray.100" typography="body2">
15+
{name}
16+
</Typography>
17+
<Typography typography="body1Medium">{value}</Typography>
18+
</Box>
19+
);
20+
};
21+
22+
export default InfoCard;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { SxProps, Theme } from '@mui/material/styles';
2+
3+
export const wrapper: SxProps<Theme> = {
4+
maxWidth: '387px',
5+
p: '16px',
6+
display: 'flex',
7+
flexDirection: 'column',
8+
gap: '16px',
9+
backgroundColor: 'white.main',
10+
11+
borderRadius: '4px',
12+
boxShadow: '6px 6px 4px 0px rgba(0, 0, 0, 0.25)',
13+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { FC } from 'react';
2+
import { Box, Typography } from '@mui/material';
3+
import Image from 'next/image';
4+
5+
import InfoCard from '@/app/organisations/[id]/components/info-card/InfoCard';
6+
7+
import * as styles from './OrganisationDashboard.styles';
8+
9+
interface OrganisationDashboardProps {
10+
organisation: {
11+
avatar: string;
12+
name: string;
13+
address: string;
14+
owner: string;
15+
description?: string;
16+
};
17+
}
18+
19+
const OrganisationDashboard: FC<OrganisationDashboardProps> = ({
20+
organisation,
21+
}) => {
22+
return (
23+
<Box sx={styles.wrapper}>
24+
<Image
25+
src={organisation.avatar}
26+
alt="organisation picture"
27+
width={355}
28+
height={200}
29+
/>
30+
<Typography typography="h5Bold">{organisation.name}</Typography>
31+
<Box>
32+
<InfoCard name="Адреса" value={organisation.address} />
33+
<InfoCard name="Власник" value={organisation.owner} />
34+
</Box>
35+
<Typography typography="body2">{organisation.description}</Typography>
36+
</Box>
37+
);
38+
};
39+
40+
export default OrganisationDashboard;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { FC, PropsWithChildren } from 'react';
2+
import { Box, Typography } from '@mui/material';
3+
4+
import OrganisationDashboard from '@/app/organisations/[id]/components/organisation-dasboard/OrganisationDashboard';
5+
6+
import * as styles from './Organisation.styles';
7+
8+
const organisation = {
9+
avatar: '/svgs/organisation-default.svg',
10+
name: 'Автосервіс Гепард',
11+
address: 'м. Київ, проспект Перемоги 10',
12+
owner: 'Новиков Ігор Михайлович',
13+
description:
14+
'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur culpa cupiditate dignissimos dolorem dolores, error expedita fugit id itaque minima minus molestias nemo, nobis nostrum nulla placeat quis repudiandae! Quod.\n',
15+
};
16+
17+
const OrganisationLayout: FC<PropsWithChildren> = ({ children }) => {
18+
return (
19+
<Box sx={styles.layout}>
20+
<OrganisationDashboard organisation={organisation} />
21+
{children}
22+
</Box>
23+
);
24+
};
25+
26+
export default OrganisationLayout;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const OrganisationPage = () => {
2+
return <div>Organisation Page</div>;
3+
};
4+
5+
export default OrganisationPage;

0 commit comments

Comments
 (0)