diff --git a/Dockerfile b/Dockerfile index 197970e5..b3ea037a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,5 @@ FROM nginx:1.24.0 WORKDIR /usr/share/nginx/html RUN rm -rf ./* COPY --from=builder /app/dist . +COPY nginx.conf /etc/nginx/nginx.conf ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yml b/docker-compose.yml index 0eebef31..a56784fd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,4 +7,7 @@ services: build: context: . ports: - - 8081:80 \ No newline at end of file + - 8081:80 + # volumes: + # - ./nginx.conf:/etc/nginx/conf.d/default.conf + \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 00000000..169a7c7f --- /dev/null +++ b/nginx.conf @@ -0,0 +1,39 @@ +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + # include /etc/nginx/conf.d/*.conf; + server { + listen 80; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } +} +} \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 2fc4b0dd..ce4fdd3d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -12,7 +12,6 @@ import "./assets/demo/demo.css"; import "./assets/css/nucleo-icons.css"; import "@fortawesome/fontawesome-free/css/all.min.css"; import ContextInfo from "./contexts/InfoContext.jsx"; -// import LandingPage from "./views/LandingPage.jsx"; import CoursesPanel from "./views/CoursesPanel/CoursesPanel.jsx"; import Shopping from "./views/Shopping/Shopping.jsx"; import Verification from "./views/Verification/Verification.jsx"; @@ -100,10 +99,6 @@ function App() { path="/aboutUs" element={} > - {/* } - > */} } diff --git a/src/assets/css/Profile.module.css b/src/assets/css/Profile.module.css index c2044d6e..2bf6c9cc 100644 --- a/src/assets/css/Profile.module.css +++ b/src/assets/css/Profile.module.css @@ -9,7 +9,7 @@ display: flex; flex-direction: row; /* align-items: center; */ - justify-content: space-between; + justify-content: center; width: 100%; /* background-color: #1e1e1e; */ /* background-color: var(--dark); */ @@ -22,9 +22,8 @@ justify-content: space-between; gap: 30px; border-radius: 10px; - - height: 93vh; - margin-top: 20px; + height: 90vh; + margin-top: 5vh; margin-left: 30px; margin-right: 30px; } @@ -60,8 +59,8 @@ .rightpart { width: 900px; - height: 100%; - margin-top: 20px; + height: 90vh; + margin-top: 5vh; margin-bottom: 10px; padding: 10px; border-radius: 15px; @@ -224,9 +223,12 @@ .leftpart { display: none; } + .rightpart { + margin-left: 5vh; + } } -@media only screen and (max-width: 541px) { +@media only screen and (max-width: 620px) { .main { flex-direction: column-reverse; } @@ -234,5 +236,6 @@ .rightpart { max-width: 90vw; max-height: 80vh; + /* margin: 2.5vw; */ } } \ No newline at end of file diff --git a/src/assets/css/Timeline/Timeline_Profile.module.css b/src/assets/css/Timeline/Timeline_Profile.module.css index fa918424..52beb858 100644 --- a/src/assets/css/Timeline/Timeline_Profile.module.css +++ b/src/assets/css/Timeline/Timeline_Profile.module.css @@ -6,7 +6,7 @@ /* justify-content: space-between; */ width: 100%; /* margin-right: 4vw; */ - height: 90vh; + height: 100%; border-radius: 15px; position: sticky; } diff --git a/src/components/Navbars/AdminNavbar.jsx b/src/components/Navbars/AdminNavbar.jsx index 59b5de8b..b0817456 100644 --- a/src/components/Navbars/AdminNavbar.jsx +++ b/src/components/Navbars/AdminNavbar.jsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import routes from "../../route.jsx"; import * as style from "../Navbars/AdminNavbar.module.css"; import { useNavigate, useLocation } from "react-router-dom"; - +import { userUserName } from "../../hooks/useUserName.jsx"; // reactstrap components import { Collapse, @@ -16,6 +16,11 @@ import { function AdminNavbar() { const [isOpen, setIsOpen] = useState(false); const toggle = () => setIsOpen(!isOpen); + const routes_FirstPart = routes.slice(0, 5); + const routes_SecondPart = routes.slice(6); + // console.log("First Part: ", routes_FirstPart); + // console.log("Second Part: ", routes_SecondPart); + const {profile, setProfile, loading} = userUserName(); return ( - { - routes.map((route) => - ( - - - - {" "} - {route.rtlName} - - - ))} + { + routes_FirstPart.map((route) => + ( + + + + {" "} + {route.rtlName} + + + ))} + + { + }} + > + + {" "} + {"پروفایل"} + + + { + routes_SecondPart.map((route) => + ( + + + + {" "} + {route.rtlName} + + + ))} { + localStorage.removeItem("authTokens"); }} > @@ -54,7 +81,28 @@ function AdminNavbar() { { - routes.map((route) => + routes_FirstPart.map((route) => + ( + + + + {" "} + {route.rtlName} + + + ))} + + { + }} + > + + {" "} + {"پروفایل"} + + + { + routes_SecondPart.map((route) => ( diff --git a/src/components/ui/PopUp.jsx b/src/components/ui/PopUp.jsx index 5d94db74..ed063f10 100644 --- a/src/components/ui/PopUp.jsx +++ b/src/components/ui/PopUp.jsx @@ -39,24 +39,6 @@ export default function PopUp({ children, className, style, ...props }) { سفارش ها - - - - {" "} - جست جو{" "} - - - - - - {" "} - پروفایل - - diff --git a/src/hooks/useUserName.jsx b/src/hooks/useUserName.jsx index e0019674..8e5d4121 100644 --- a/src/hooks/useUserName.jsx +++ b/src/hooks/useUserName.jsx @@ -21,13 +21,19 @@ export const userUserName = () => { ); const data = await profileResponse.json(); changeInfo("userName", data.username); + setProfile(data.username) + setLoading(false) } catch (error) { console.error(error); } }; - if(info.userName !== ""){ + if(info.userName === ""){ fetchData(); } + else{ + setProfile(info.userName) + setLoading(false) + } }, []); return { profile, setProfile, loading }; diff --git a/src/views/Landing/mainpart.jsx b/src/views/Landing/mainpart.jsx index f58566c2..d143beba 100644 --- a/src/views/Landing/mainpart.jsx +++ b/src/views/Landing/mainpart.jsx @@ -9,7 +9,6 @@ import { useNavigate } from "react-router-dom"; const Mainpart = () => { const navigate =useNavigate() - return ( @@ -28,6 +27,7 @@ const Mainpart = () => { پیشنهادات و انتقادات : katyushaiust@gmail.com + v0.0 diff --git a/src/views/Sidebar/Sidebar.jsx b/src/views/Sidebar/Sidebar.jsx index 7934afc5..83ca378b 100644 --- a/src/views/Sidebar/Sidebar.jsx +++ b/src/views/Sidebar/Sidebar.jsx @@ -125,12 +125,13 @@ ${styles.icon}`} { + localStorage.removeItem("authTokens"); e.preventDefault(); - Navigate("/order"); + Navigate("/"); }} > - - سفارش ها + + خروج {loading ? ( diff --git a/src/views/UserPorfile/IsThisMe_Function.jsx b/src/views/UserPorfile/IsThisMe_Function.jsx index d4f6c301..24a3033f 100644 --- a/src/views/UserPorfile/IsThisMe_Function.jsx +++ b/src/views/UserPorfile/IsThisMe_Function.jsx @@ -1,6 +1,4 @@ import React from "react"; -import { usesProfileMe } from "../../hooks/useProfileMe"; -import { GETProfileData } from "../../hooks/GETProfileData.jsx"; import { userUserName } from "../../hooks/useUserName.jsx"; export default function IsThisMe_Function (id) @@ -8,7 +6,7 @@ export default function IsThisMe_Function (id) const {profile, setProfile, loading} = userUserName(); let IsThisMe = false; if (profile != null) { - IsThisMe = (profile.username == id); + IsThisMe = (profile == id); } return IsThisMe; } \ No newline at end of file
پیشنهادات و انتقادات :
katyushaiust@gmail.com
v0.0
سفارش ها
خروج