mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 14:54:22 +00:00
💥 Improve GroupResourcePanel
This commit is contained in:
parent
1fe27c2002
commit
0cdbaf6bb6
5 changed files with 8 additions and 8 deletions
|
@ -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}/> Delete
|
||||
</SafetyButton>
|
||||
)
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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}/> Leave
|
||||
</Button>
|
||||
</SafetyButton>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
|
|
Loading…
Reference in a new issue