From b3c6ae2460a0ab0898a2a75c88d0bf031e18319f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi?= Date: Mon, 6 Jan 2025 11:49:51 +0100 Subject: [PATCH] feat: move class selection to profile dropdown in header for improved user experience --- src/app/components/Header/contents.tsx | 54 ++++++++++++++------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/src/app/components/Header/contents.tsx b/src/app/components/Header/contents.tsx index 0c0c811..f4ef08c 100644 --- a/src/app/components/Header/contents.tsx +++ b/src/app/components/Header/contents.tsx @@ -46,29 +46,6 @@ export const HeaderContent = ({ user }: { user?: User }) => {

Toogether

- - - { - const inputSelectedClass = classes.find( - (Class) => Class.id === selectedId, - ); - if (inputSelectedClass) - setSelectedClassId(inputSelectedClass.id); - }} - > - {classes.map((Class) => ( - - {Class.name} - - ))} - - - {user?.roles.includes("admin") ? ( @@ -98,11 +75,38 @@ export const HeaderContent = ({ user }: { user?: User }) => { size="sm" /> - - + +

Signed in as

{user?.name}

+ + { + const inputSelectedClass = classes.find( + (Class) => Class.id === selectedId, + ); + if (inputSelectedClass) + setSelectedClassId( + inputSelectedClass.id, + ); + }} + > + {classes.map((Class) => ( + + {Class.name} + + ))} + + Settings