From a4a2ba35cdb56062031d5ec2df6bc22ce73851fe Mon Sep 17 00:00:00 2001 From: andrzej Date: Mon, 24 Jun 2024 23:15:48 +0200 Subject: [PATCH] fix pub create form styling --- src/app/publication/create/page.tsx | 2 +- src/app/ui/forms/pub.tsx | 144 ++++++++++++++-------------- 2 files changed, 75 insertions(+), 71 deletions(-) diff --git a/src/app/publication/create/page.tsx b/src/app/publication/create/page.tsx index ced365f..425f021 100644 --- a/src/app/publication/create/page.tsx +++ b/src/app/publication/create/page.tsx @@ -29,7 +29,7 @@ export default async function Page() { Create a new entry for a publication i.e. a place you intend to submit to. - + ) diff --git a/src/app/ui/forms/pub.tsx b/src/app/ui/forms/pub.tsx index 7e7e8ea..2d65032 100644 --- a/src/app/ui/forms/pub.tsx +++ b/src/app/ui/forms/pub.tsx @@ -23,6 +23,8 @@ import { import GenresTrigger from "./genresTrigger" import GenreCheckbox from "./genreCheckbox" import { randomPublicationTitle } from "app/lib/shortStoryTitleGenerator" +import { ComponentProps } from "react" +import { Genre } from "@prisma/client" const formSchema = z.object({ title: z.string().min(2).max(50), @@ -31,7 +33,7 @@ const formSchema = z.object({ genres: z.array(z.number()), }) -export default function PubForm({ genres, createPub }) { +export default function PubForm({ genres, createPub, className }: ComponentProps<"div"> & { genres: Array, createPub: (data: any) => void }) { const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { @@ -75,85 +77,87 @@ export default function PubForm({ genres, createPub }) { .toLowerCase() + ".com" return ( -
- - ( - - Title - - - - - - )} - /> - - ( - - Website - - - - - - )} - /> - -
+
+ + ( - - Genres - - - - {genres.map((item) => ( - { - return ( - - ) - }} - /> - ))} - - - - - - )} - /> - - - ( - - Query after (days) + + Title - + )} /> -
- - - + ( + + Website + + + + + + )} + /> + +
+ ( + + Genres + + + + {genres.map((item) => ( + { + return ( + + ) + }} + /> + ))} + + + + + + )} + /> + + + ( + + Query after (days) + + + + + + )} + /> +
+ + + + +
) }