From 623cd2ce52e5da02da7d88cdc5dc471dc70c26eb Mon Sep 17 00:00:00 2001 From: Fred Date: Mon, 5 Feb 2024 14:26:10 +0100 Subject: [PATCH 1/2] add home card and fix bug --- .../src/components/CardModel/card-model.css | 2 +- .../src/components/Dashboards/RowDash2.jsx | 8 +-- frontend/src/components/Headers/header.css | 5 +- frontend/src/components/HomeCard/HomeCard.css | 50 ++++++++++++++++ frontend/src/components/HomeCard/HomeCard.jsx | 59 +++++++++++++++++++ frontend/src/components/NavBar/NavBar.jsx | 21 +++---- frontend/src/contexts/AdminContext.jsx | 10 ++-- frontend/src/main.jsx | 2 - frontend/src/pages/HomeOffer/Home.css | 10 +++- frontend/src/pages/HomeOffer/Home.jsx | 6 +- .../pages/ProfileUser/UserProfileModel.jsx | 3 - 11 files changed, 142 insertions(+), 34 deletions(-) create mode 100644 frontend/src/components/HomeCard/HomeCard.css create mode 100644 frontend/src/components/HomeCard/HomeCard.jsx diff --git a/frontend/src/components/CardModel/card-model.css b/frontend/src/components/CardModel/card-model.css index c7accca..91c7df3 100644 --- a/frontend/src/components/CardModel/card-model.css +++ b/frontend/src/components/CardModel/card-model.css @@ -3,7 +3,7 @@ padding: 30px; border-radius: 6px; box-shadow: 5px 5px 15px 8px rgba(217, 217, 217, 0.53); - margin: 20px 0; + margin: 30px 0; overflow: hidden; } diff --git a/frontend/src/components/Dashboards/RowDash2.jsx b/frontend/src/components/Dashboards/RowDash2.jsx index f9fa0d2..91babef 100644 --- a/frontend/src/components/Dashboards/RowDash2.jsx +++ b/frontend/src/components/Dashboards/RowDash2.jsx @@ -1,11 +1,11 @@ import React, { useState, useEffect } from "react"; import "./RowDash.css"; import { useGlobalContext } from "../../contexts/GlobalContext"; -import { useAdminContext } from "../../contexts/AdminContext"; +// import { useAdminContext } from "../../contexts/AdminContext"; function RowDash2() { const { apiService } = useGlobalContext(); - const { goToEditUser } = useAdminContext(); + // const { goToEditUser } = useAdminContext(); const [users, setUsers] = useState([]); const fetchUsers = async () => { @@ -48,14 +48,14 @@ function RowDash2() {

{user.email}

{user.is_admin}

- + */}
+ ); +} + +export default HomeCard; diff --git a/frontend/src/components/NavBar/NavBar.jsx b/frontend/src/components/NavBar/NavBar.jsx index fb5ee4a..3620cdf 100644 --- a/frontend/src/components/NavBar/NavBar.jsx +++ b/frontend/src/components/NavBar/NavBar.jsx @@ -74,20 +74,13 @@ export default function Navbar() { ) : null}
{user ? ( - <> - - Se déconnecter - - - {" "} - {/* */} - Hello {user.firstname} - - + + Se déconnecter + ) : ( <> diff --git a/frontend/src/contexts/AdminContext.jsx b/frontend/src/contexts/AdminContext.jsx index 96abfd5..3b2ef96 100644 --- a/frontend/src/contexts/AdminContext.jsx +++ b/frontend/src/contexts/AdminContext.jsx @@ -37,9 +37,9 @@ function AdminContextProvider({ children }) { navigate(`/dashboard/edit-offer/${id}`); }; - const goToEditUser = (id) => { - navigate(`/dashboard/edit-user/${id}`); - }; + // const goToEditUser = (id) => { + // navigate(`/dashboard/edit-user/${id}`); + // }; const contextValues = useMemo( () => ({ @@ -51,7 +51,7 @@ function AdminContextProvider({ children }) { handleOffers, handleUsers, goToEditOffer, - goToEditUser, + // goToEditUser, }), [ isAdmin, @@ -62,7 +62,7 @@ function AdminContextProvider({ children }) { handleAddOffer, handleOffers, goToEditOffer, - goToEditUser, + // goToEditUser, ] ); diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx index f314e7a..cc6a868 100644 --- a/frontend/src/main.jsx +++ b/frontend/src/main.jsx @@ -94,9 +94,7 @@ const router = createBrowserRouter([ path: "/dashboard", element: ( - {/* */} - {/* */} ), loader: async () => currentAdmin(apiService), diff --git a/frontend/src/pages/HomeOffer/Home.css b/frontend/src/pages/HomeOffer/Home.css index 0b83ef6..60b91ab 100644 --- a/frontend/src/pages/HomeOffer/Home.css +++ b/frontend/src/pages/HomeOffer/Home.css @@ -1,6 +1,9 @@ +.container-page h1 { + margin-bottom: 50px; +} + @media all and (min-width: 1000px) { #home .offer-container { - margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; @@ -13,4 +16,9 @@ width: 30%; margin-bottom: 20px; } + .container-page span { + color: var(--second-color); + font-weight: 600; + font-style: italic; + } } diff --git a/frontend/src/pages/HomeOffer/Home.jsx b/frontend/src/pages/HomeOffer/Home.jsx index 97d7e07..54c1050 100644 --- a/frontend/src/pages/HomeOffer/Home.jsx +++ b/frontend/src/pages/HomeOffer/Home.jsx @@ -4,6 +4,7 @@ import { useGlobalContext } from "../../contexts/GlobalContext"; import "./Home.css"; import CardOffre from "../../components/CardModel/CardOffre"; import { useUserContext } from "../../contexts/UserContext"; +import HomeCard from "../../components/HomeCard/HomeCard"; function Home() { const { goToOffer, apiService } = useGlobalContext(); @@ -62,7 +63,10 @@ function Home() { textTitle2="Nos offres d'emploi" />
-

Les offres qui matchent !

+ +

+ Les offres qui matchent ! +

{matchingOffers.map((offer) => ( )}
-
); From 4d8964dabcb8bea8bea404118c73a17bc8d1ec8d Mon Sep 17 00:00:00 2001 From: Fred Date: Mon, 5 Feb 2024 16:11:09 +0100 Subject: [PATCH 2/2] fix some css and add footer --- frontend/src/App.css | 3 +- frontend/src/App.jsx | 2 + frontend/src/components/Footer/Footer.jsx | 18 ++ frontend/src/components/Footer/footer.css | 0 .../src/components/Headers/HeaderLongUser.jsx | 39 ++- frontend/src/components/Headers/header.css | 32 ++- frontend/src/pages/ProfileUser/EditUser.jsx | 8 +- .../src/pages/ProfileUser/EditUserDash.jsx | 254 ------------------ .../pages/ProfileUser/UserProfileModel.jsx | 14 + .../pages/ProfileUser/user-profile-model.css | 7 + 10 files changed, 93 insertions(+), 284 deletions(-) create mode 100644 frontend/src/components/Footer/Footer.jsx create mode 100644 frontend/src/components/Footer/footer.css delete mode 100644 frontend/src/pages/ProfileUser/EditUserDash.jsx diff --git a/frontend/src/App.css b/frontend/src/App.css index c6f1bbc..45e1e1b 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -121,8 +121,9 @@ body { .container-page.with-rounded-border { border-top-left-radius: 50px; border-top-right-radius: 50px; - padding-top: 70px; + padding-top: 10px; margin-top: -170px; + margin-bottom: 100px; } #sign.container-page.with-rounded-border, diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index ed62ce5..5eedbee 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,5 +1,6 @@ import { Outlet } from "react-router-dom"; import Navbar from "./components/NavBar/NavBar"; +import Footer from "./components/Footer/Footer"; import "./App.css"; function App() { @@ -7,6 +8,7 @@ function App() { <> +