diff --git a/.changeset/pretty-walls-lick.md b/.changeset/pretty-walls-lick.md new file mode 100644 index 00000000..719bfcb2 --- /dev/null +++ b/.changeset/pretty-walls-lick.md @@ -0,0 +1,6 @@ +--- +"@premieroctet/next-admin": patch +--- + +feat: update preset to apply on body +feat: add form header to add new resource from edit form diff --git a/apps/example/app/[locale]/layout.tsx b/apps/example/app/[locale]/layout.tsx index 67698d41..aa170762 100644 --- a/apps/example/app/[locale]/layout.tsx +++ b/apps/example/app/[locale]/layout.tsx @@ -20,9 +20,7 @@ export default function Layout({ return ( - - {children} - + {children} ); } diff --git a/packages/next-admin/src/components/Form.tsx b/packages/next-admin/src/components/Form.tsx index 58a6f8f1..8beb8f69 100644 --- a/packages/next-admin/src/components/Form.tsx +++ b/packages/next-admin/src/components/Form.tsx @@ -2,6 +2,7 @@ import { CheckCircleIcon, InformationCircleIcon, + PlusSmallIcon, TrashIcon, } from "@heroicons/react/24/outline"; import { Prisma } from "@prisma/client"; @@ -56,7 +57,7 @@ import JsonField from "./inputs/JsonField"; import NullField from "./inputs/NullField"; import SelectWidget from "./inputs/SelectWidget"; import TextareaWidget from "./inputs/TextareaWidget"; -import Button from "./radix/Button"; +import Button, { buttonVariants } from "./radix/Button"; import { TooltipContent, TooltipPortal, @@ -64,6 +65,7 @@ import { TooltipRoot, TooltipTrigger, } from "./radix/Tooltip"; +import Link from "next/link"; const RichTextField = dynamic(() => import("./inputs/RichText/RichTextField"), { ssr: false, @@ -158,9 +160,9 @@ const Form = ({ } return ( -
+
{((edit && canEdit) || (!edit && canCreate)) && ( -
+