Skip to content

Commit 470185f

Browse files
feat: Add shared Container component, refactor CRM dashboard table layout with it, adjust responsive heights for filters and tables, and include viewport meta tags.
1 parent 2e9facc commit 470185f

File tree

11 files changed

+70
-30
lines changed

11 files changed

+70
-30
lines changed

src/app/(crm)/crm/dashboard/layout.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
align-items: center;
77
justify-content: flex-start;
88
box-sizing: border-box;
9-
padding-top: 20px;
109
}
1110

1211
.crm {
@@ -19,5 +18,6 @@
1918
align-items: center;
2019
justify-content: flex-start;
2120
gap: 10px;
21+
box-sizing: border-box;
2222
}
2323
}

src/app/(crm)/crm/dashboard/style.module.scss

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/app/(crm)/layout.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { Metadata } from 'next';
88
import { Roboto } from 'next/font/google';
99
import '@/app/(website)/globals.css';
1010
import { Provider } from '@/shared/Provider';
11+
import Head from 'next/head';
1112

1213
const roboto = Roboto({
1314
variable: '--font-roboto',
@@ -26,6 +27,18 @@ export default async function RootLayout({
2627
}>) {
2728
return (
2829
<html lang="en">
30+
<Head>
31+
<link
32+
rel="preload"
33+
href="/crm_icon.svg"
34+
as="image"
35+
type="image/svg+xml"
36+
/>
37+
<meta
38+
name="viewport"
39+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
40+
/>
41+
</Head>
2942
<body className={roboto.variable}>
3043
<Provider>{children}</Provider>
3144
</body>

src/app/(website)/layout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export default async function RootLayout({
3737
as="image"
3838
type="image/svg+xml"
3939
/>
40+
<meta
41+
name="viewport"
42+
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
43+
/>
4044
</Head>
4145
<body className={roboto.variable}>
4246
<Provider>

src/pages_layer/Dashboard/Container/style.module.scss

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/shared/ui/Container/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import s from './style.module.scss';
3+
4+
type ContainerProps = {
5+
children: React.ReactElement;
6+
};
7+
export const Container: React.FC<ContainerProps> = ({ children }) => {
8+
return <div className={s.container}>{children}</div>;
9+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.container {
2+
width: 100%;
3+
overflow-y: scroll;
4+
border-right: 1px solid rgba(white, 0.1);
5+
border-left: 1px solid rgba(white, 0.1);
6+
height: calc(100vh - 30px - 20px - 155px - 60px);
7+
8+
@media (max-width: 775px) {
9+
height: calc(100vh - 30px - 20px - 178px - 60px);
10+
}
11+
@media (max-width: 590px) {
12+
height: calc(100vh - 30px - 20px - 228px - 60px);
13+
}
14+
@media (max-width: 400px) {
15+
height: calc(100vh - 30px - 20px - 64px - 60px);
16+
}
17+
}

src/widgets/CRMDashboard/Filters/style.module.scss

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
.container {
22
width: 100%;
3-
min-height: 155px;
4-
height: fit-content;
3+
max-height: 155px;
4+
height: 155px;
55
box-sizing: border-box;
66
padding: 3px;
77
border: 1px solid rgba(white, 0.1);
8+
9+
@media (max-width: 775px) {
10+
max-height: 178px;
11+
height: 178px;
12+
}
813
@media (max-width: 590px) {
9-
height: auto;
14+
max-height: 228px;
15+
height: 228px;
1016
}
1117
@media (max-width: 400px) {
12-
min-height: 30px;
18+
max-height: 64px;
19+
height: 64px;
1320
}
1421
}
1522

src/widgets/CRMDashboard/Table/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import { TableHeader } from './ui/TableHeader';
44
import { TableBody } from './ui/TableBody';
55
import { TablePaging } from './ui/TablePaging';
66
import { TableModal } from './ui/TableModal';
7+
import { Container } from '@/shared/ui/Container';
78

89
export const Table = () => {
910
return (
1011
<div className={s.container}>
1112
<TableHeader />
12-
<TableBody />
13+
<Container>
14+
<TableBody />
15+
</Container>
1316
<TablePaging />
1417
<TableModal />
1518
</div>
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
.container {
22
width: 100%;
3-
flex: 1;
43
display: flex;
54
flex-direction: column;
65
align-items: center;
76
justify-content: space-between;
7+
height: calc(100vh - 30px - 20px - 155px);
8+
9+
@media (max-width: 775px) {
10+
height: calc(100vh - 30px - 20px - 178px);
11+
}
12+
@media (max-width: 590px) {
13+
height: calc(100vh - 30px - 20px - 228px);
14+
}
15+
@media (max-width: 400px) {
16+
height: calc(100vh - 30px - 20px - 64px);
17+
}
818
}

0 commit comments

Comments
 (0)