mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-01 07:37:55 -05:00
Leave group button different text + no confirm when alone
This commit is contained in:
@@ -41,6 +41,7 @@ export function GroupCard({
|
||||
hideWeapons?: boolean;
|
||||
}) {
|
||||
const fetcher = useFetcher();
|
||||
const leaveQFetcher = useFetcher();
|
||||
|
||||
return (
|
||||
<section
|
||||
@@ -120,7 +121,8 @@ export function GroupCard({
|
||||
</SubmitButton>
|
||||
</fetcher.Form>
|
||||
) : null}
|
||||
{ownGroup ? (
|
||||
|
||||
{ownGroup && group.members!.length > 1 ? (
|
||||
<FormWithConfirm
|
||||
dialogHeading="Leave this group?"
|
||||
fields={[["_action", "LEAVE_GROUP"]]}
|
||||
@@ -132,6 +134,20 @@ export function GroupCard({
|
||||
</Button>
|
||||
</FormWithConfirm>
|
||||
) : null}
|
||||
{/* Leave without confirm if alone */}
|
||||
{ownGroup && group.members!.length === 1 ? (
|
||||
<leaveQFetcher.Form method="POST" action={SENDOUQ_LOOKING_PAGE}>
|
||||
<SubmitButton
|
||||
_action="LEAVE_GROUP"
|
||||
variant="minimal-destructive"
|
||||
size="tiny"
|
||||
state={fetcher.state}
|
||||
className="mx-auto"
|
||||
>
|
||||
Leave queue
|
||||
</SubmitButton>
|
||||
</leaveQFetcher.Form>
|
||||
) : null}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user