Skip to content

Commit

Permalink
refactor(app): move position of the comment form
Browse files Browse the repository at this point in the history
  • Loading branch information
Javan-Odhiambo committed May 30, 2024
1 parent 5fc47b9 commit 9cbe173
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions src/app/dashboard/innovation/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,34 @@ const InnovationDetailPage = ({ params }: InnovationDetailPageProps) => {
<></>
)}
</section>

<section className="px-6 pb-4">
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
<FormField
control={form.control}
name="message"
render={({ field }) => (
<FormItem>
<FormLabel>Comment</FormLabel>
<FormControl>
<Textarea placeholder="Type comment here..." {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<Button
className="rounded-full"
type="submit"
size={"lg"}
disabled={isCreatingComment}
>
Submit
</Button>
</form>
</Form>
</section>
{/* Comments container */}
<section className="p-7 space-y-4">
{comments?.map((comment, index) => (
Expand Down Expand Up @@ -300,33 +328,6 @@ const InnovationDetailPage = ({ params }: InnovationDetailPageProps) => {
/>
</section>

<section className="px-6 pb-4">
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
<FormField
control={form.control}
name="message"
render={({ field }) => (
<FormItem>
<FormLabel>Comment</FormLabel>
<FormControl>
<Textarea placeholder="Type comment here..." {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<Button
className="rounded-full"
type="submit"
size={"lg"}
disabled={isCreatingComment}
>
Submit
</Button>
</form>
</Form>
</section>
</main>
);
};
Expand Down

0 comments on commit 9cbe173

Please sign in to comment.