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

💥 Improve GroupResourcePanel

This commit is contained in:
Steffo 2021-10-12 02:26:27 +02:00
parent 1fe27c2002
commit 0cdbaf6bb6
Signed by: steffo
GPG key ID: 6965406171929D01
5 changed files with 8 additions and 8 deletions

View file

@ -34,7 +34,7 @@ export function GroupDeleteButton({resource}: GroupDeleteButtonProps): JSX.Eleme
}
return (
<SafetyButton timeout={5} onClick={doDelete}>
<SafetyButton timeout={3} onClick={doDelete}>
<FontAwesomeIcon icon={faTrash} pulse={resource.busy}/>&nbsp;Delete
</SafetyButton>
)

View file

@ -15,7 +15,7 @@ export interface GroupJoinButtonProps {
export function GroupJoinButton({resource}: GroupJoinButtonProps): JSX.Element | null {
const authorization = useAuthorizationContext()
const trueMembers = [resource.value.owner, ...resource.value.members]
const trueMembers = [...new Set([resource.value.owner, ...resource.value.members])]
const doJoin =
React.useCallback(

View file

@ -1,10 +1,10 @@
import {faUserMinus} from "@fortawesome/free-solid-svg-icons"
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
import {Button} from "@steffo/bluelib-react"
import * as React from "react"
import {useAuthorizationContext} from "../../contexts/authorization"
import {ManagedResource} from "../../hooks/useManagedViewSet"
import {SophonResearchGroup} from "../../types/SophonTypes"
import {SafetyButton} from "../elements/SafetyButton"
export interface GroupLeaveButtonProps {
@ -15,7 +15,7 @@ export interface GroupLeaveButtonProps {
export function GroupLeaveButton({resource}: GroupLeaveButtonProps): JSX.Element | null {
const authorization = useAuthorizationContext()
const trueMembers = [resource.value.owner, ...resource.value.members]
const trueMembers = [...new Set([resource.value.owner, ...resource.value.members])]
const doLeave =
React.useCallback(
@ -39,8 +39,8 @@ export function GroupLeaveButton({resource}: GroupLeaveButtonProps): JSX.Element
}
return (
<Button disabled={resource.busy} onClick={doLeave} bluelibClassNames={resource.busy ? "color-yellow" : ""}>
<SafetyButton timeout={3} disabled={resource.busy} onClick={doLeave} bluelibClassNames={resource.busy ? "color-yellow" : ""}>
<FontAwesomeIcon icon={faUserMinus} pulse={resource.busy}/>&nbsp;Leave
</Button>
</SafetyButton>
)
}

View file

@ -18,7 +18,7 @@ export interface GroupResourcePanelProps {
export function GroupResourcePanel({resource}: GroupResourcePanelProps): JSX.Element {
const icon = resource.value.access === "OPEN" ? faGlobe : faEnvelope
const trueMembers = [resource.value.owner, ...resource.value.members]
const trueMembers = [...new Set([resource.value.owner, ...resource.value.members])]
return (
<ResourcePanel>

View file

@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"lib": [
"dom",
"dom.iterable",