From 3ca0062dfa470fb4cb14bad87e7ee9b58bbaf825 Mon Sep 17 00:00:00 2001 From: Laurian-Dufrechou Date: Wed, 3 May 2023 00:51:18 +0200 Subject: [PATCH] refactor(userProfile -> profile): refactor userProfile to profile (page + folder) --- src/components/Navbar.tsx | 2 +- .../layout/dashboard/left_panel/LeftPanel.tsx | 2 +- .../{user_profile => profile}/CustomCheckbox.tsx | 0 .../{user_profile => profile}/CustomEditable.tsx | 0 .../CustomEditableArea.tsx | 0 .../CustomFalseEditable.tsx | 0 .../CustomRadioGender.tsx | 0 .../CustomRangeSlider.tsx | 0 .../{user_profile => profile}/CustomSlider.tsx | 0 .../ModalChoosePassion.tsx | 0 .../ModalModifyImages.tsx | 0 .../{user_profile => profile}/ProfileTagList.tsx | 0 src/middleware.ts | 11 +++-------- src/pages/dashboard.tsx | 4 ---- src/pages/{userProfile.tsx => profile.tsx} | 16 ++++++++-------- 15 files changed, 13 insertions(+), 22 deletions(-) rename src/components/layout/{user_profile => profile}/CustomCheckbox.tsx (100%) rename src/components/layout/{user_profile => profile}/CustomEditable.tsx (100%) rename src/components/layout/{user_profile => profile}/CustomEditableArea.tsx (100%) rename src/components/layout/{user_profile => profile}/CustomFalseEditable.tsx (100%) rename src/components/layout/{user_profile => profile}/CustomRadioGender.tsx (100%) rename src/components/layout/{user_profile => profile}/CustomRangeSlider.tsx (100%) rename src/components/layout/{user_profile => profile}/CustomSlider.tsx (100%) rename src/components/layout/{user_profile => profile}/ModalChoosePassion.tsx (100%) rename src/components/layout/{user_profile => profile}/ModalModifyImages.tsx (100%) rename src/components/layout/{user_profile => profile}/ProfileTagList.tsx (100%) rename src/pages/{userProfile.tsx => profile.tsx} (94%) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index a5b93ff..f75154b 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -69,7 +69,7 @@ export default function Navbar({ variant = "fixed" }: Props) { Tableau de bord - + Profile diff --git a/src/components/layout/dashboard/left_panel/LeftPanel.tsx b/src/components/layout/dashboard/left_panel/LeftPanel.tsx index 1b9a926..6673645 100644 --- a/src/components/layout/dashboard/left_panel/LeftPanel.tsx +++ b/src/components/layout/dashboard/left_panel/LeftPanel.tsx @@ -84,7 +84,7 @@ export default function LeftPanel(props) { } - onClickHandler={() => router.push("/userProfile")} + onClickHandler={() => router.push("/profile")} > Profile diff --git a/src/components/layout/user_profile/CustomCheckbox.tsx b/src/components/layout/profile/CustomCheckbox.tsx similarity index 100% rename from src/components/layout/user_profile/CustomCheckbox.tsx rename to src/components/layout/profile/CustomCheckbox.tsx diff --git a/src/components/layout/user_profile/CustomEditable.tsx b/src/components/layout/profile/CustomEditable.tsx similarity index 100% rename from src/components/layout/user_profile/CustomEditable.tsx rename to src/components/layout/profile/CustomEditable.tsx diff --git a/src/components/layout/user_profile/CustomEditableArea.tsx b/src/components/layout/profile/CustomEditableArea.tsx similarity index 100% rename from src/components/layout/user_profile/CustomEditableArea.tsx rename to src/components/layout/profile/CustomEditableArea.tsx diff --git a/src/components/layout/user_profile/CustomFalseEditable.tsx b/src/components/layout/profile/CustomFalseEditable.tsx similarity index 100% rename from src/components/layout/user_profile/CustomFalseEditable.tsx rename to src/components/layout/profile/CustomFalseEditable.tsx diff --git a/src/components/layout/user_profile/CustomRadioGender.tsx b/src/components/layout/profile/CustomRadioGender.tsx similarity index 100% rename from src/components/layout/user_profile/CustomRadioGender.tsx rename to src/components/layout/profile/CustomRadioGender.tsx diff --git a/src/components/layout/user_profile/CustomRangeSlider.tsx b/src/components/layout/profile/CustomRangeSlider.tsx similarity index 100% rename from src/components/layout/user_profile/CustomRangeSlider.tsx rename to src/components/layout/profile/CustomRangeSlider.tsx diff --git a/src/components/layout/user_profile/CustomSlider.tsx b/src/components/layout/profile/CustomSlider.tsx similarity index 100% rename from src/components/layout/user_profile/CustomSlider.tsx rename to src/components/layout/profile/CustomSlider.tsx diff --git a/src/components/layout/user_profile/ModalChoosePassion.tsx b/src/components/layout/profile/ModalChoosePassion.tsx similarity index 100% rename from src/components/layout/user_profile/ModalChoosePassion.tsx rename to src/components/layout/profile/ModalChoosePassion.tsx diff --git a/src/components/layout/user_profile/ModalModifyImages.tsx b/src/components/layout/profile/ModalModifyImages.tsx similarity index 100% rename from src/components/layout/user_profile/ModalModifyImages.tsx rename to src/components/layout/profile/ModalModifyImages.tsx diff --git a/src/components/layout/user_profile/ProfileTagList.tsx b/src/components/layout/profile/ProfileTagList.tsx similarity index 100% rename from src/components/layout/user_profile/ProfileTagList.tsx rename to src/components/layout/profile/ProfileTagList.tsx diff --git a/src/middleware.ts b/src/middleware.ts index 1e954db..4cac0dd 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,10 +1,5 @@ -export {default} from 'next-auth/middleware'; +export { default } from "next-auth/middleware"; export const config = { - matcher: [ - '/dashboard', - '/userProfile', - '/chat', - '/chat/:path*', - ], -}; \ No newline at end of file + matcher: ["/dashboard", "/profile", "/chat", "/chat/:path*"], +}; diff --git a/src/pages/dashboard.tsx b/src/pages/dashboard.tsx index 8d8cb6b..9176d5f 100644 --- a/src/pages/dashboard.tsx +++ b/src/pages/dashboard.tsx @@ -45,10 +45,6 @@ export default function Dashboard() { }, }); - /* - Erreur quand je retourn de userProfile à dashboard - */ - const { data: listUsers, isError: isErrorListUsers, diff --git a/src/pages/userProfile.tsx b/src/pages/profile.tsx similarity index 94% rename from src/pages/userProfile.tsx rename to src/pages/profile.tsx index 2ee9143..f510602 100644 --- a/src/pages/userProfile.tsx +++ b/src/pages/profile.tsx @@ -18,15 +18,15 @@ import { VStack, } from "@chakra-ui/react"; -import ModalModifyImages from "@/components/layout/user_profile/ModalModifyImages"; -import ModalChoosePassion from "@/components/layout/user_profile/ModalChoosePassion"; -import ProfileTagList from "@/components/layout/user_profile/ProfileTagList"; +import ModalModifyImages from "@/components/layout/profile/ModalModifyImages"; +import ModalChoosePassion from "@/components/layout/profile/ModalChoosePassion"; +import ProfileTagList from "@/components/layout/profile/ProfileTagList"; import LoadingPage from "@/components/LoadingPage"; -import CustomEditable from "@/components/layout/user_profile/CustomEditable"; -import CustomFalseEditable from "@/components/layout/user_profile/CustomFalseEditable"; -import CustomEditableArea from "@/components/layout/user_profile/CustomEditableArea"; -import CustomRadioGender from "@/components/layout/user_profile/CustomRadioGender"; -import CustomRangeSlider from "@/components/layout/user_profile/CustomRangeSlider"; +import CustomEditable from "@/components/layout/profile/CustomEditable"; +import CustomFalseEditable from "@/components/layout/profile/CustomFalseEditable"; +import CustomEditableArea from "@/components/layout/profile/CustomEditableArea"; +import CustomRadioGender from "@/components/layout/profile/CustomRadioGender"; +import CustomRangeSlider from "@/components/layout/profile/CustomRangeSlider"; // import CustomSlider from "@/components/layout/user_profile/CustomSlider"; import { useEffect, useState } from "react";