fix(art): action button is outside context
This commit is contained in:
+58
-57
@@ -153,12 +153,13 @@ export default async function ArtifactFormPage({
|
|||||||
</div>
|
</div>
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<ArtifactFormWrapper
|
||||||
<ArtifactFormWrapper
|
id="mainform"
|
||||||
id="mainform"
|
edit={q ? { token: q.editToken, sub: q.id } : undefined}
|
||||||
edit={q ? { token: q.editToken, sub: q.id } : undefined}
|
enka={config.enka}
|
||||||
enka={config.enka}
|
className="contents"
|
||||||
>
|
>
|
||||||
|
<CardContent>
|
||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
<div className="grid gap-2">
|
<div className="grid gap-2">
|
||||||
<Label htmlFor="name">ชื่อ*</Label>
|
<Label htmlFor="name">ชื่อ*</Label>
|
||||||
@@ -222,58 +223,58 @@ export default async function ArtifactFormPage({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ArtifactFormWrapper>
|
</CardContent>
|
||||||
</CardContent>
|
<CardFooter className="flex justify-between gap-2">
|
||||||
<CardFooter className="flex justify-between gap-2">
|
<div className="flex gap-2">
|
||||||
<div className="flex gap-2">
|
<SimpleTooltip text="โดเนทลัดคิว ขั้นต่ำ 10 บาท">
|
||||||
<SimpleTooltip text="โดเนทลัดคิว ขั้นต่ำ 10 บาท">
|
<Link href="/donate" target="_blank" rel="noreferrer">
|
||||||
<Link href="/donate" target="_blank" rel="noreferrer">
|
<Button variant="outline" type="button">
|
||||||
<Button variant="outline" type="button">
|
<CircleDollarSign />
|
||||||
<CircleDollarSign />
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
</SimpleTooltip>
|
|
||||||
<Tooltip>
|
|
||||||
<RulesDialog>
|
|
||||||
<TooltipTrigger asChild>
|
|
||||||
<Button variant="destructive" type="button">
|
|
||||||
<BookAlert />
|
|
||||||
</Button>
|
</Button>
|
||||||
</TooltipTrigger>
|
</Link>
|
||||||
</RulesDialog>
|
</SimpleTooltip>
|
||||||
<TooltipContent>อ่านกฏการลงคิว</TooltipContent>
|
<Tooltip>
|
||||||
</Tooltip>
|
<RulesDialog>
|
||||||
{editing ? (
|
<TooltipTrigger asChild>
|
||||||
<Button variant="destructive" asChild>
|
<Button variant="destructive" type="button">
|
||||||
<Link href="?">ยกเลิก</Link>
|
<BookAlert />
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
</TooltipTrigger>
|
||||||
<Suspense>
|
</RulesDialog>
|
||||||
<LiveButton />
|
<TooltipContent>อ่านกฏการลงคิว</TooltipContent>
|
||||||
</Suspense>
|
</Tooltip>
|
||||||
)}
|
{editing ? (
|
||||||
</div>
|
<Button variant="destructive" asChild>
|
||||||
<div className="flex items-center gap-2">
|
<Link href="?">ยกเลิก</Link>
|
||||||
<Kbd>
|
</Button>
|
||||||
{count} / {config.limit < 0 ? "∞" : config.limit} คิว
|
) : (
|
||||||
</Kbd>
|
<Suspense>
|
||||||
<SimpleTooltip text="ส่งเลยจัฟลูกพี่">
|
<LiveButton />
|
||||||
<ActionButton
|
</Suspense>
|
||||||
type="submit"
|
)}
|
||||||
form="mainform"
|
</div>
|
||||||
action="provider"
|
<div className="flex items-center gap-2">
|
||||||
disabled={
|
<Kbd>
|
||||||
(!!q ||
|
{count} / {config.limit < 0 ? "∞" : config.limit} คิว
|
||||||
config.locked ||
|
</Kbd>
|
||||||
(config.limit >= 0 && count >= config.limit)) &&
|
<SimpleTooltip text="ส่งเลยจัฟลูกพี่">
|
||||||
!editing
|
<ActionButton
|
||||||
}
|
type="submit"
|
||||||
>
|
form="mainform"
|
||||||
{editing ? <PencilIcon /> : <SendHorizonal />}
|
action="provider"
|
||||||
</ActionButton>
|
disabled={
|
||||||
</SimpleTooltip>
|
(!!q ||
|
||||||
</div>
|
config.locked ||
|
||||||
</CardFooter>
|
(config.limit >= 0 && count >= config.limit)) &&
|
||||||
|
!editing
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{editing ? <PencilIcon /> : <SendHorizonal />}
|
||||||
|
</ActionButton>
|
||||||
|
</SimpleTooltip>
|
||||||
|
</div>
|
||||||
|
</CardFooter>
|
||||||
|
</ArtifactFormWrapper>
|
||||||
</Card>
|
</Card>
|
||||||
{sid && !q && <ClearCookie />}
|
{sid && !q && <ClearCookie />}
|
||||||
<WarningDialog />
|
<WarningDialog />
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ export type ActionSubmitContextData = {
|
|||||||
|
|
||||||
export const ActionSubmitContext = createContext<ActionSubmitContextData>({
|
export const ActionSubmitContext = createContext<ActionSubmitContextData>({
|
||||||
listenForComplete: (r) => {
|
listenForComplete: (r) => {
|
||||||
|
console.warn("submit context not caught");
|
||||||
r();
|
r();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user