1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 23:04:21 +00:00

🔧 Improve group flow

This commit is contained in:
Steffo 2021-10-13 05:21:38 +02:00
parent 4d7877feee
commit 7641efa624
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 10 additions and 4 deletions

View file

@ -147,7 +147,7 @@ export function GroupCreateBox({viewSet, resource}: GroupCreateBoxProps): JSX.El
<Box>
<Details>
<Details.Summary>
{resource ? <>Edit <I>{resource.value.name}</I></> : "Create a new group"}
{resource ? <>Edit <I>{resource.value.name}</I></> : "Create a new research group"}
</Details.Summary>
<Details.Content>
<Form>

View file

@ -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 ? <UAnnotation>{user.value.username}</UAnnotation> : user.value.username
return (
<ListUnordered.Item bluelibClassNames={index === 0 ? "color-blue" : ""} key={id}>
{user.value.username}
{username}
</ListUnordered.Item>
)
})
@ -39,7 +45,7 @@ export function GroupMembersBox({resource}: GroupMembersBoxProps): JSX.Element |
return (
<Box>
<Heading level={3}>
Members of <Idiomatic>{resource.value.name}</Idiomatic>
<FontAwesomeIcon icon={faUsersCog}/> Members of <Idiomatic>{resource.value.name}</Idiomatic>
</Heading>
<ListUnordered>
{users}