Update admin layout and pages (#976)

This commit is contained in:
Luke Vella 2024-01-13 15:09:48 +07:00 committed by GitHub
parent 0ba7e9ce91
commit a1bac0c986
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 2053 additions and 1260 deletions

View file

@ -16,6 +16,7 @@ import { useUnmount } from "react-use";
import { PollSettingsForm } from "@/components/forms/poll-settings";
import { Trans } from "@/components/trans";
import { setCookie } from "@/utils/cookies";
import { usePostHog } from "@/utils/posthog";
import { trpc } from "@/utils/trpc/client";
@ -62,12 +63,16 @@ export const CreatePoll: React.FunctionComponent = () => {
const posthog = usePostHog();
const queryClient = trpc.useUtils();
const createPoll = trpc.polls.create.useMutation();
const createPoll = trpc.polls.create.useMutation({
networkMode: "always",
onSuccess: () => {
setCookie("new-poll", "1");
},
});
return (
<Form {...form}>
<form
className="pb-16"
onSubmit={form.handleSubmit(async (formData) => {
const title = required(formData?.title);
@ -100,7 +105,7 @@ export const CreatePoll: React.FunctionComponent = () => {
);
})}
>
<div className="mx-auto max-w-4xl space-y-4 p-2 sm:p-8">
<div className="mx-auto max-w-4xl space-y-4">
<Card>
<CardHeader>
<CardTitle>