🐛 Fix redundant use of card in edit options

This commit is contained in:
Luke Vella 2023-07-25 18:44:03 +01:00
parent 197c6804fb
commit ab070c0d80

View file

@ -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>
); );