From 9fe9bf59667904326e32b3a75f21dabf22d9e018 Mon Sep 17 00:00:00 2001 From: maurice-wegerif <102590927+maurice-wegerif@users.noreply.github.com> Date: Wed, 21 Feb 2024 18:42:14 +0100 Subject: [PATCH] Vf 90 mine soknader (#263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Lag routing til profilside * Lag profil komponent og legg til under /profil/:id * lint errors * fiks index.ts feil * fiks bildelink * Lag mine søknaderside og profilinfo * Lag søknaderkomponent * fiks linterrors * Fiks header posisjon * fiks merge --------- Co-authored-by: mauricew --- src/App.tsx | 8 +++- src/components/Header/UserAvatar.tsx | 8 +++- .../MineSoknader/components/Applications.tsx | 39 ++++++++++++++++++ .../MineSoknader/components/MineSoknader.tsx | 41 +++++++++++++++++++ .../MineSoknader/components/ProfileModal.tsx | 26 ++++++++++++ src/pages/public/MineSoknader/index.ts | 3 ++ 6 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 src/pages/public/MineSoknader/components/Applications.tsx create mode 100644 src/pages/public/MineSoknader/components/MineSoknader.tsx create mode 100644 src/pages/public/MineSoknader/components/ProfileModal.tsx create mode 100644 src/pages/public/MineSoknader/index.ts diff --git a/src/App.tsx b/src/App.tsx index 6774d648..69171dd5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,6 +12,7 @@ import MainPage from "pages/public"; import ControlPanel from "pages/controlpanel"; import Profil from "pages/public/Profil/components/Profil"; import Utlegg from "pages/public/User/Utlegg"; +import MineSoknader from "pages/public/MineSoknader"; import appRoutes from "./pages/public/routes"; import controlPanelRoutes from "./pages/controlpanel/routes"; @@ -46,9 +47,14 @@ const routes = createBrowserRouter([ path: "profil/:id", element: , }, + { + path: "mine-soknader/:id", + element: , + }, ], }, - { path: "/utlegg", element: }], + { path: "/utlegg", element: }, + ], }, ]); diff --git a/src/components/Header/UserAvatar.tsx b/src/components/Header/UserAvatar.tsx index 23678b74..721acd3f 100644 --- a/src/components/Header/UserAvatar.tsx +++ b/src/components/Header/UserAvatar.tsx @@ -21,10 +21,14 @@ const UserAvatar = () => {
  • - Mine søknader + + Mine Søknader +
  • - Mine utlegg + + Mine utlegg +
  • Logg ut diff --git a/src/pages/public/MineSoknader/components/Applications.tsx b/src/pages/public/MineSoknader/components/Applications.tsx new file mode 100644 index 00000000..db7ba181 --- /dev/null +++ b/src/pages/public/MineSoknader/components/Applications.tsx @@ -0,0 +1,39 @@ +import React from "react"; + +interface ApplicationProps { + applications: Application[]; +} + +interface Application { + role: string; + status: string; + expectedAction: string; +} + +const Applications = ({ applications }: ApplicationProps) => { + return ( +
    + {applications.map((application) => { + return ( +
    +

    + {application.role} +

    +

    + Status: + {" "} + {application.status} +

    +

    + Forventet Handling: + {" "} + {application.expectedAction} +

    +
    + ); + })} +
    + ); +}; + +export default Applications; diff --git a/src/pages/public/MineSoknader/components/MineSoknader.tsx b/src/pages/public/MineSoknader/components/MineSoknader.tsx new file mode 100644 index 00000000..b7e09eb1 --- /dev/null +++ b/src/pages/public/MineSoknader/components/MineSoknader.tsx @@ -0,0 +1,41 @@ +import React from "react"; +import ProfileModal from "./ProfileModal"; +import Applications from "./Applications"; + +const MineSoknader = (): JSX.Element => { + return ( +
    +
    +

    + Mine Søknader +

    + + +
    +
    + ); +}; + +export default MineSoknader; diff --git a/src/pages/public/MineSoknader/components/ProfileModal.tsx b/src/pages/public/MineSoknader/components/ProfileModal.tsx new file mode 100644 index 00000000..2e316336 --- /dev/null +++ b/src/pages/public/MineSoknader/components/ProfileModal.tsx @@ -0,0 +1,26 @@ +import React from "react"; + +interface ProfileModalProps { + imgUrl: string; + name: string; +} + +const ProfileModal = ({ imgUrl, name }: ProfileModalProps): JSX.Element => { + return ( +
    +
    + Aaryan +
    +

    + Du er logget inn som +

    +

    {name}

    +
    + ); +}; + +export default ProfileModal; diff --git a/src/pages/public/MineSoknader/index.ts b/src/pages/public/MineSoknader/index.ts new file mode 100644 index 00000000..4c1865ac --- /dev/null +++ b/src/pages/public/MineSoknader/index.ts @@ -0,0 +1,3 @@ +import MineSoknader from "./components/MineSoknader"; + +export default MineSoknader;