Skip to content

Commit

Permalink
Merge pull request #24 from eight-labs/fix/redirecting-to-form-detail…
Browse files Browse the repository at this point in the history
…-when-deleting

Fix/redirecting to form detail when deleting
  • Loading branch information
ephraimduncan authored Feb 22, 2024
2 parents eace93c + 1c85c9b commit 31414ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function DeleteFormDialog({ formId }: DeleteFormDialogProps) {
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<div className="group flex items-center gap-2 rounded-md hover:cursor-pointer dark:bg-gray-900">
<div className="group flex w-full items-center gap-2 rounded-md hover:cursor-pointer dark:bg-none">
<TrashIcon className="h-4 w-4 duration-300 group-hover:text-red-500 dark:text-white" />
<span className="hover:text-red-500">Delete</span>
</div>
Expand Down
7 changes: 3 additions & 4 deletions src/app/(main)/dashboard/_components/form-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import type { RouterOutputs } from "@/trpc/shared";

import { CopyButton } from "@/components/copy-button";
import { DeleteFormDialog } from "./delete-form-dialog";
import { CopyIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { Button } from "@/components/ui/button";
import { DotsVerticalIcon } from "@radix-ui/react-icons";
import { formatDistanceToNow } from "date-fns";
import { DeleteFormDialog } from "./delete-form-dialog";

type FormCardProp = {
form: RouterOutputs["form"]["userForms"][number];
Expand Down Expand Up @@ -43,7 +42,7 @@ export function FormCard({ form }: FormCardProp) {
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem>
<DropdownMenuItem onClick={(e) => e.preventDefault()}>
<DeleteFormDialog formId={form.id} />
</DropdownMenuItem>
</DropdownMenuContent>
Expand Down

0 comments on commit 31414ec

Please sign in to comment.