diff --git a/prisma/dev.db b/prisma/dev.db index 9edcab7..eb7bb0b 100644 Binary files a/prisma/dev.db and b/prisma/dev.db differ diff --git a/src/app/story/columns.tsx b/src/app/story/columns.tsx index dca5bdf..2beee52 100644 --- a/src/app/story/columns.tsx +++ b/src/app/story/columns.tsx @@ -4,12 +4,10 @@ import { StoryWithGenres } from "./page" import { ArrowUpDown } from "lucide-react" import { Button } from "@/components/ui/button" import GenreBadges from "app/ui/genreBadges" -import { actions } from "app/ui/tables/actions" -import { TextInputCell } from "app/ui/tables/inputs/textInput" import { selectCol } from "app/ui/tables/selectColumn" import NumberInputCell from "app/ui/tables/inputs/numberInput" import { formSchema } from "app/ui/forms/story" - +import { TextInputCell } from "app/ui/tables/inputs/textInput" const columnHelper = createColumnHelper() export const columns: ColumnDef[] = [ diff --git a/src/app/tailwind.css b/src/app/tailwind.css index c0fc71c..0ff5be1 100644 --- a/src/app/tailwind.css +++ b/src/app/tailwind.css @@ -959,6 +959,14 @@ body { width: 100vw; } +.w-8 { + width: 2rem; +} + +.w-16 { + width: 4rem; +} + .min-w-\[8rem\] { min-width: 8rem; } diff --git a/src/app/ui/forms/pub.tsx b/src/app/ui/forms/pub.tsx index 0ad60f6..43bd326 100644 --- a/src/app/ui/forms/pub.tsx +++ b/src/app/ui/forms/pub.tsx @@ -3,7 +3,6 @@ import { z } from "zod" import { zodResolver } from "@hookform/resolvers/zod" import { useForm } from "react-hook-form" -import { Button } from "@/components/ui/button" import { Form, FormControl, @@ -16,12 +15,6 @@ import { import { Input } from "@/components/ui/input" import { toast } from "@/components/ui/use-toast" -import { - Popover, - PopoverContent, -} from "@/components/ui/popover" -import GenresTrigger from "./genresTrigger" -import GenreCheckbox from "./genreCheckbox" import { randomPublicationTitle } from "app/lib/shortStoryTitleGenerator" import { ComponentProps } from "react" import { Genre } from "@prisma/client" diff --git a/src/app/ui/tables/inputs/numberInput.tsx b/src/app/ui/tables/inputs/numberInput.tsx index 0a8517d..0b495cb 100644 --- a/src/app/ui/tables/inputs/numberInput.tsx +++ b/src/app/ui/tables/inputs/numberInput.tsx @@ -64,7 +64,7 @@ export default function NumberInputCell(props: CellContext) { className="w-full h-fit flex items-center justify-center" tabIndex={0} onKeyDown={e => { - if (e.code === "Space" && !isActive) { + if (e.code === "Enter" && !isActive) { e.preventDefault() setIsActive(true) } @@ -84,6 +84,7 @@ export default function NumberInputCell(props: CellContext) { ) { }, }) - function onSubmit(value: z.infer) { + async function onSubmit(value: z.infer) { toast({ title: "You submitted the following values:", description: ( @@ -35,7 +35,7 @@ export function TextInputCell(props: CellContext) { ), }) - updateField({ + const res = await updateField({ id, table, string: value[column], @@ -62,7 +62,7 @@ export function TextInputCell(props: CellContext) { className="w-full h-fit flex items-center justify-center" tabIndex={0} onKeyDown={e => { - if (e.code === "Space" && !isActive) { + if (e.code === "Enter" && !isActive) { e.preventDefault() setIsActive(true) }