mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-21 04:46:22 +02:00
✨ Update admin layout and pages (#976)
This commit is contained in:
parent
0ba7e9ce91
commit
a1bac0c986
81 changed files with 2053 additions and 1260 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue