diff options
| author | MohamedBassem <me@mbassem.com> | 2024-03-21 00:32:25 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-03-21 00:32:25 +0000 |
| commit | 8f14e9f50fae51e09fdfb529af389a046b4672f6 (patch) | |
| tree | 3043bc29fe0c3746964e9c94fa4e61228183565f | |
| parent | 23941ff79ac201a233bda5e2d03bd4f76f52c8fd (diff) | |
| download | karakeep-8f14e9f50fae51e09fdfb529af389a046b4672f6.tar.zst | |
fix: Reset add list form form on submission
| -rw-r--r-- | apps/web/components/dashboard/lists/DeleteListButton.tsx | 6 | ||||
| -rw-r--r-- | apps/web/components/dashboard/sidebar/NewListModal.tsx | 3 | ||||
| -rw-r--r-- | apps/web/components/ui/button.tsx | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/apps/web/components/dashboard/lists/DeleteListButton.tsx b/apps/web/components/dashboard/lists/DeleteListButton.tsx index f5fcb18b..345c81d2 100644 --- a/apps/web/components/dashboard/lists/DeleteListButton.tsx +++ b/apps/web/components/dashboard/lists/DeleteListButton.tsx @@ -15,7 +15,7 @@ import { } from "@/components/ui/dialog"; import { toast } from "@/components/ui/use-toast"; import { api } from "@/lib/trpc"; -import { Trash } from "lucide-react"; +import { Trash2 } from "lucide-react"; import type { ZBookmarkList } from "@hoarder/trpc/types/lists"; @@ -43,8 +43,8 @@ export default function DeleteListButton({ list }: { list: ZBookmarkList }) { return ( <Dialog open={isDialogOpen} onOpenChange={setDialogOpen}> <DialogTrigger asChild> - <Button className="mt-auto flex gap-2" variant="destructive"> - <Trash className="size-5" /> + <Button className="mt-auto flex gap-2" variant="destructiveOutline"> + <Trash2 className="size-5" /> <span className="hidden md:block">Delete List</span> </Button> </DialogTrigger> diff --git a/apps/web/components/dashboard/sidebar/NewListModal.tsx b/apps/web/components/dashboard/sidebar/NewListModal.tsx index 31c35d6c..5169fbb5 100644 --- a/apps/web/components/dashboard/sidebar/NewListModal.tsx +++ b/apps/web/components/dashboard/sidebar/NewListModal.tsx @@ -51,7 +51,7 @@ export default function NewListModal() { resolver: zodResolver(formSchema), defaultValues: { name: "", - icon: "💡", + icon: "🚀", }, }); @@ -64,6 +64,7 @@ export default function NewListModal() { }); listsInvalidationFunction(); setOpen(false); + form.reset(); }, onError: (e) => { if (e.data?.code == "BAD_REQUEST") { diff --git a/apps/web/components/ui/button.tsx b/apps/web/components/ui/button.tsx index 5ed8df91..42c8f137 100644 --- a/apps/web/components/ui/button.tsx +++ b/apps/web/components/ui/button.tsx @@ -12,6 +12,8 @@ const buttonVariants = cva( default: "bg-primary text-primary-foreground hover:bg-primary/90", destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", + destructiveOutline: + "border border-destructive bg-transparent text-destructive hover:bg-destructive/90 hover:text-destructive-foreground", outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground", secondary: |
