From 7641efa624532786fc10a34f1b0b856ab03b1baa Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 13 Oct 2021 05:21:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Improve=20group=20flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/group/GroupCreateBox.tsx | 2 +- frontend/src/components/group/GroupMembersBox.tsx | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/group/GroupCreateBox.tsx b/frontend/src/components/group/GroupCreateBox.tsx index 01f2896..9698734 100644 --- a/frontend/src/components/group/GroupCreateBox.tsx +++ b/frontend/src/components/group/GroupCreateBox.tsx @@ -147,7 +147,7 @@ export function GroupCreateBox({viewSet, resource}: GroupCreateBoxProps): JSX.El
- {resource ? <>Edit {resource.value.name} : "Create a new group"} + {resource ? <>Edit {resource.value.name} : "Create a new research group"}
diff --git a/frontend/src/components/group/GroupMembersBox.tsx b/frontend/src/components/group/GroupMembersBox.tsx index 282c819..c264a11 100644 --- a/frontend/src/components/group/GroupMembersBox.tsx +++ b/frontend/src/components/group/GroupMembersBox.tsx @@ -1,5 +1,8 @@ -import {Box, Heading, Idiomatic, ListUnordered} from "@steffo/bluelib-react" +import {faUsersCog} from "@fortawesome/free-solid-svg-icons" +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" +import {Box, Heading, Idiomatic, ListUnordered, UAnnotation} from "@steffo/bluelib-react" import * as React from "react" +import {useAuthorizationContext} from "../../contexts/authorization" import {useCacheContext} from "../../contexts/cache" import {ManagedResource} from "../../hooks/useManagedViewSet" import {SophonResearchGroup} from "../../types/SophonTypes" @@ -11,6 +14,7 @@ export interface GroupMembersBoxProps { export function GroupMembersBox({resource}: GroupMembersBoxProps): JSX.Element | null { + const authorization = useAuthorizationContext() const cache = useCacheContext() if(!cache) { @@ -29,9 +33,11 @@ export function GroupMembersBox({resource}: GroupMembersBoxProps): JSX.Element | return null } + const username = id === authorization?.state.user?.id ? {user.value.username} : user.value.username + return ( - {user.value.username} + {username} ) }) @@ -39,7 +45,7 @@ export function GroupMembersBox({resource}: GroupMembersBoxProps): JSX.Element | return ( - Members of {resource.value.name} + Members of {resource.value.name} {users}