mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-07 13:11:49 +02:00
🐛 Fix redundant use of card in edit options
This commit is contained in:
parent
197c6804fb
commit
ab070c0d80
1 changed files with 4 additions and 21 deletions
|
@ -1,11 +1,5 @@
|
||||||
import { Button } from "@rallly/ui/button";
|
import { Button } from "@rallly/ui/button";
|
||||||
import {
|
import { CardFooter } from "@rallly/ui/card";
|
||||||
Card,
|
|
||||||
CardDescription,
|
|
||||||
CardFooter,
|
|
||||||
CardHeader,
|
|
||||||
CardTitle,
|
|
||||||
} from "@rallly/ui/card";
|
|
||||||
import { Form } from "@rallly/ui/form";
|
import { Form } from "@rallly/ui/form";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
@ -72,6 +66,7 @@ const Page: NextPageWithLayout = () => {
|
||||||
return (
|
return (
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<form
|
<form
|
||||||
|
className="mx-auto max-w-3xl"
|
||||||
onSubmit={form.handleSubmit((data) => {
|
onSubmit={form.handleSubmit((data) => {
|
||||||
const encodedOptions = data.options.map(encodeDateOption);
|
const encodedOptions = data.options.map(encodeDateOption);
|
||||||
const optionsToDelete = poll.options.filter((option) => {
|
const optionsToDelete = poll.options.filter((option) => {
|
||||||
|
@ -124,19 +119,7 @@ const Page: NextPageWithLayout = () => {
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Card className="mx-auto max-w-4xl">
|
<PollOptionsForm>
|
||||||
<CardHeader>
|
|
||||||
<CardTitle>
|
|
||||||
<Trans i18nKey="editOptions" />
|
|
||||||
</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
<Trans
|
|
||||||
i18nKey="editOptionsDescription"
|
|
||||||
defaults="Change the options available in your poll."
|
|
||||||
/>
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<PollOptionsForm />
|
|
||||||
<CardFooter className="justify-between">
|
<CardFooter className="justify-between">
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<Link href={pollLink}>
|
<Link href={pollLink}>
|
||||||
|
@ -147,7 +130,7 @@ const Page: NextPageWithLayout = () => {
|
||||||
<Trans i18nKey="save" />
|
<Trans i18nKey="save" />
|
||||||
</Button>
|
</Button>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
</Card>
|
</PollOptionsForm>
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue