Skip to content

Commit

Permalink
🐛 Add FormMessage under comment form
Browse files Browse the repository at this point in the history
  • Loading branch information
anxiubin committed Dec 13, 2023
1 parent d662e5a commit 5859000
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/features/post/widgets/comment-form/CommentForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { Button } from "@/components/ui/button"
import { Form, FormControl, FormField, FormItem } from "@/components/ui/form"
import {
Form,
FormControl,
FormField,
FormItem,
FormMessage,
} from "@/components/ui/form"
import * as z from "zod"
import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form"
Expand Down Expand Up @@ -83,6 +89,7 @@ const CommentForm = ({ postId }: ICommentFormProps) => {
disabled={isLoading}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { Button } from "@/components/ui/button"
import { Form, FormControl, FormField, FormItem } from "@/components/ui/form"
import {
Form,
FormControl,
FormField,
FormItem,
FormMessage,
} from "@/components/ui/form"
import * as z from "zod"
import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form"
Expand Down Expand Up @@ -91,6 +97,7 @@ const CommentUpdateForm = ({
disabled={isLoading}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
Expand Down

0 comments on commit 5859000

Please sign in to comment.