diff --git a/frontend/src/features/dashboard/components/Grid.module.css b/frontend/src/features/dashboard/components/Grid.module.css new file mode 100644 index 0000000..f6c2d68 --- /dev/null +++ b/frontend/src/features/dashboard/components/Grid.module.css @@ -0,0 +1,6 @@ +.grid { + display: grid; + justify-content: center; + align-items: center; + width: 100%; +} \ No newline at end of file diff --git a/frontend/src/features/dashboard/components/Grid.tsx b/frontend/src/features/dashboard/components/Grid.tsx new file mode 100644 index 0000000..a513d2d --- /dev/null +++ b/frontend/src/features/dashboard/components/Grid.tsx @@ -0,0 +1,13 @@ +import type { ReactElement } from "react"; +import styles from "./Grid.module.css" + +export function Grid():ReactElement { + + return ( + <> +
+

Content is here

+
+ + ); +} \ No newline at end of file diff --git a/frontend/src/features/dashboard/components/Header.module.css b/frontend/src/features/dashboard/components/Header.module.css new file mode 100644 index 0000000..c5b373c --- /dev/null +++ b/frontend/src/features/dashboard/components/Header.module.css @@ -0,0 +1,7 @@ + +.profile { + display: grid; + justify-content: end; + align-items: center; + width: 100%; +} \ No newline at end of file diff --git a/frontend/src/features/dashboard/components/Header.tsx b/frontend/src/features/dashboard/components/Header.tsx new file mode 100644 index 0000000..7cf12a9 --- /dev/null +++ b/frontend/src/features/dashboard/components/Header.tsx @@ -0,0 +1,13 @@ +import type { ReactElement } from "react"; +import styles from "./Header.module.css" + +export function Header():ReactElement { + + return ( + <> +
+

profile

+
+ + ); +} \ No newline at end of file diff --git a/frontend/src/features/dashboard/components/Right_sidebar.module.css b/frontend/src/features/dashboard/components/Right_sidebar.module.css new file mode 100644 index 0000000..fcf6dff --- /dev/null +++ b/frontend/src/features/dashboard/components/Right_sidebar.module.css @@ -0,0 +1,6 @@ +.right_sidebar { + display: grid; + align-content: center; + justify-content: center; + height: 100vh; +} \ No newline at end of file diff --git a/frontend/src/features/dashboard/components/Right_sidebar.tsx b/frontend/src/features/dashboard/components/Right_sidebar.tsx new file mode 100644 index 0000000..a24fccc --- /dev/null +++ b/frontend/src/features/dashboard/components/Right_sidebar.tsx @@ -0,0 +1,13 @@ +import type { ReactElement } from "react"; +import styles from "./Right_sidebar.module.css" + +export function Right_sidebar():ReactElement { + + return ( + <> +
+

right_sidebar

+
+ + ); +} \ No newline at end of file diff --git a/frontend/src/features/dashboard/components/Sidebar.module.css b/frontend/src/features/dashboard/components/Sidebar.module.css new file mode 100644 index 0000000..6495a21 --- /dev/null +++ b/frontend/src/features/dashboard/components/Sidebar.module.css @@ -0,0 +1,14 @@ +.sidebar_elements{ + display: grid; + align-content: start; + gap: 15px; +} +.logo { + display: grid; + grid-template-columns: 1fr 1fr; +} +.p { + display: grid; + text-align: center; + place-items: center; +} \ No newline at end of file diff --git a/frontend/src/features/dashboard/components/Sidebar.tsx b/frontend/src/features/dashboard/components/Sidebar.tsx new file mode 100644 index 0000000..5603914 --- /dev/null +++ b/frontend/src/features/dashboard/components/Sidebar.tsx @@ -0,0 +1,19 @@ +import type { ReactElement } from "react"; +import styles from "./Sidebar.module.css" + +export function Sidebar():ReactElement { + + return ( + <> +
+

logo

+

Project name

+
+
+ + + +
+ + ); +} \ No newline at end of file diff --git a/frontend/src/index.css b/frontend/src/index.css index 6254f3c..4f073b7 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -6,8 +6,6 @@ a:focus,a:active{outline: none;} nav,footer,header,aside{display: block;} html,body{ - height:100%;width:100%; - padding: 30px; font-family: 'Manrope', sans-serif; user-select: none; font-size:100%;line-height:1;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%;} diff --git a/frontend/src/layouts/AuthLayout.css b/frontend/src/layouts/Auth/AuthLayout.module.css similarity index 96% rename from frontend/src/layouts/AuthLayout.css rename to frontend/src/layouts/Auth/AuthLayout.module.css index 60bdf9e..da35bdc 100644 --- a/frontend/src/layouts/AuthLayout.css +++ b/frontend/src/layouts/Auth/AuthLayout.module.css @@ -1,10 +1,9 @@ .wrapper { + position: absolute; + inset: 30px; display: flex; flex-direction: row; - min-height: auto; - width: 100%; overflow: hidden; - height: 100%; box-shadow: 1px 1px 20px 1px rgba(68, 68, 68, 0.5); border-radius: 40px; border: 1px solid #444; diff --git a/frontend/src/layouts/AuthLayout.tsx b/frontend/src/layouts/Auth/AuthLayout.tsx similarity index 61% rename from frontend/src/layouts/AuthLayout.tsx rename to frontend/src/layouts/Auth/AuthLayout.tsx index 55edc2a..548aa21 100644 --- a/frontend/src/layouts/AuthLayout.tsx +++ b/frontend/src/layouts/Auth/AuthLayout.tsx @@ -1,28 +1,28 @@ import type { ReactNode } from "react"; -import "./AuthLayout.css"; -import logo from "../assets/LOGO.png"; -import img_1 from "../assets/paper.png"; -import img_2 from "../assets/PC.png"; -import img_3 from "../assets/graphics.png"; +import styles from "./AuthLayout.module.css"; +import logo from "../../assets/LOGO.png"; +import img_1 from "../../assets/paper.png"; +import img_2 from "../../assets/PC.png"; +import img_3 from "../../assets/graphics.png"; export function AuthLayout({ children }: { children: ReactNode }) { return ( -
-
-
-
-
- LOGO -
-
+
+
+
+
+
+ LOGO +
+
The DisExcel
-
+
Project
-
+

Избавляем от ручной работы.
Переводим процессы из бумаги в Excel,
@@ -31,69 +31,69 @@ export function AuthLayout({ children }: { children: ReactNode }) {

-
-
-
+
+
+
{/* 1 */} -
- img -
Бумага
-
+
+ img +
Бумага
+
Ручная работа, ошибки, потери
-
+
{/* 2 */} -
- img -
Excel
-
+
+ img +
Excel
+
Структура, формулы, автоматизация
-
+
{/* 3 */} -
- img -
1С / Отчеты
-
+
+ img +
1С / Отчеты
+
Готовые процессы, аналитика, контроль
-
-
+
+
{/* 1 */} -
+
Экономим
время
-
+
{/* 2 */} -
+
Снижаем
ошибки
-
+
{/* 3 */} -
+
Автоматизируем
процессы
-
+
{/* 4 */} -
+
diff --git a/frontend/src/layouts/Main/Dashboard.module.css b/frontend/src/layouts/Main/Dashboard.module.css new file mode 100644 index 0000000..9df92b2 --- /dev/null +++ b/frontend/src/layouts/Main/Dashboard.module.css @@ -0,0 +1,36 @@ + +* { + outline: 1px solid red; +} +.wrapper { + display: grid; + grid-template-columns: 20% 1fr; + height: 100vh; +} +.left_sidebar{ + display: grid; + align-content: start; + gap:10px; +} + +.header { + display: grid; +} + +.content { + display: grid; +} + +.wrapper_1 { + display: grid; + grid-template-rows: 5vh 1fr; + height: 100%; +} +.wrapper_2 { + display: grid; + grid-template-columns: 70% 1fr; + height: 100%; +} +.right_sidebar{ + display: grid; +} \ No newline at end of file diff --git a/frontend/src/layouts/Main/Dashboard.tsx b/frontend/src/layouts/Main/Dashboard.tsx new file mode 100644 index 0000000..06275c3 --- /dev/null +++ b/frontend/src/layouts/Main/Dashboard.tsx @@ -0,0 +1,68 @@ +import type { ReactNode } from "react"; +import styles from "./Dashboard.module.css" +import { useEffect, useState } from "react"; +import { useNavigate } from "react-router-dom"; +import { fetchUser } from "../../api/UserAPI/User"; +import { logout } from "../../api/token"; + + +export function MainLayout({sidebar, header, content, right_sidebar }: { sidebar: ReactNode;header: ReactNode; content: ReactNode; right_sidebar: ReactNode }) { + const navigate = useNavigate(); + const [loading, setLoading] = useState(true); + const [permissions, setPermissions] = useState>(new Set()); + + useEffect(function () { + async function load() { + try { + const user = await fetchUser(); + + const permissions = new Set(); + + for (const p of user.direct_permissions) { + permissions.add(p.permission); + } + for (const g of user.group) { + for (const p of g.permissions) { + permissions.add(p.permission); + } + } + setPermissions(permissions); + setLoading(false); + } catch { + navigate("/"); + } + } + load(); + }, [navigate]); + if (loading) { + return null; + } + async function handleLogout() { + await logout(); + navigate("/"); + } + + return ( + +
+
+ {sidebar} +
+
+
+ {header} + {/* {permissions.has("admin") &&

test

} */} + +
+
+
+ {content} +
+
+ {right_sidebar} +
+
+
+
+ ); +} \ No newline at end of file diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 5d10a4c..aaeccde 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -1,50 +1,16 @@ -import { useEffect, useState } from "react"; -import { useNavigate } from "react-router-dom"; -import { fetchUser } from "../api/UserAPI/User"; -import { logout } from "../api/token"; - - +import { MainLayout } from "../layouts/Main/Dashboard"; +import { Sidebar} from "../features/dashboard/components/Sidebar"; +import { Header } from "../features/dashboard/components/Header"; +import { Grid } from "../features/dashboard/components/Grid"; +import { Right_sidebar } from "../features/dashboard/components/Right_sidebar"; export function DashboardPage() { - const navigate = useNavigate(); - const [loading, setLoading] = useState(true); - const [permissions, setPermissions] = useState>(new Set()); - - useEffect(function () { - async function load() { - try { - const user = await fetchUser(); - - const permissions = new Set(); - - for (const p of user.direct_permissions) { - permissions.add(p.permission); - } - for (const g of user.group) { - for (const p of g.permissions) { - permissions.add(p.permission); - } - } - setPermissions(permissions); - setLoading(false); - } catch { - navigate("/"); - } - } - load(); - }, [navigate]); - if (loading) { - return null; - } - async function handleLogout() { - await logout(); - navigate("/"); - } - return ( - <> - {permissions.has("admin") && (

test

- )} - - + } + content={} + sidebar={} + right_sidebar={} + > + ); } \ No newline at end of file diff --git a/frontend/src/pages/ForgotPasswordPage.tsx b/frontend/src/pages/ForgotPasswordPage.tsx index 4a657d1..2008363 100644 --- a/frontend/src/pages/ForgotPasswordPage.tsx +++ b/frontend/src/pages/ForgotPasswordPage.tsx @@ -1,5 +1,5 @@ import { Reset } from "../features/auth/components/ResetComponent"; -import { AuthLayout } from "../layouts/AuthLayout"; +import { AuthLayout } from "../layouts/Auth/AuthLayout"; export function ForgotPasswordPage() { return ( diff --git a/frontend/src/pages/LoginPage.tsx b/frontend/src/pages/LoginPage.tsx index 88f9d6e..8a521ff 100644 --- a/frontend/src/pages/LoginPage.tsx +++ b/frontend/src/pages/LoginPage.tsx @@ -1,6 +1,6 @@ import { useNavigate } from "react-router-dom"; import { Auth } from "../features/auth/components/AuthComponent"; -import { AuthLayout } from "../layouts/AuthLayout"; +import { AuthLayout } from "../layouts/Auth/AuthLayout"; import { useEffect, useState } from "react"; import { fetchUser } from "../api/UserAPI/User"; import { getAccessToken } from "../api/token";