Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup connect to the backend + change ui #12

Merged
merged 1 commit into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ dist
dist-ssr
*.local

.env

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
151 changes: 151 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
"@emotion/styled": "^11.10.6",
"@mui/icons-material": "^5.11.16",
"@mui/material": "^5.12.0",
"@reduxjs/toolkit": "^1.9.5",
"axios": "^1.4.0",
"i18next": "^22.4.15",
"i18next-browser-languagedetector": "^7.0.1",
"i18next-http-backend": "^2.2.0",
"jwt-decode": "^3.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^12.2.2",
Expand Down
3 changes: 1 addition & 2 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"notification": "Notification",
"generalTickets": "General Tickets",
"settings": "Settings",
"lightMode": "Light Mode",
"profile": "Profile"
"lightMode": "Light Mode"
},
"dashboard": {
"heading": "Dashboard"
Expand Down
3 changes: 1 addition & 2 deletions public/locales/ua/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"notification": "Сповіщення",
"generalTickets": "Загальні квитки",
"settings": "Налаштування",
"lightMode": "Світлий режим",
"profile": "Профіль"
"lightMode": "Світлий режим"
},
"dashboard": {
"heading": "Панель приладів"
Expand Down
10 changes: 8 additions & 2 deletions src/Router/Router.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useState } from "react";
import { Route, Routes } from "react-router-dom";
import { Layout } from "../components/Layout";
import { endpoints } from "../constants";
Expand All @@ -14,10 +15,15 @@ import { Profile } from "../components/Pages/Profile/Profile";
import { ErrorPage } from "../components/Pages/ErrorPage/ErrorPage";

const Router = () => {
const [isAuth, setIsAuth] = useState(false);

return (
<Routes>
<Route path={endpoints.base} element={<Layout />}>
<Route index element={<GeneralTickets />}></Route>
<Route
path={endpoints.base}
element={<Layout isAuth={isAuth} setIsAuth={setIsAuth} />}
>
<Route index element={<GeneralTickets isAuth={isAuth} />}></Route>
<Route path={endpoints.dashboard} element={<Dashboard />} />
<Route path={endpoints.sent} element={<Sent />} />
<Route path={endpoints.received} element={<Received />} />
Expand Down
5 changes: 2 additions & 3 deletions src/components/Layout/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { Box, Grid } from "@mui/material";

const drawerWidth = 300;

const Layout = () => {
const Layout = ({ isAuth, setIsAuth }) => {
const [mobileOpen, setMobileOpen] = useState(false);
const [isAuth, setIsAuth] = useState(false);
const { palette } = useTheme();

const handleDrawerToggle = () => {
Expand Down Expand Up @@ -43,7 +42,7 @@ const Layout = () => {
color: palette.common.white,
}}
>
<Outlet />
<Outlet isAuth={isAuth} setIsAuth={setIsAuth} />
</Box>
</Grid>
);
Expand Down
Loading