From dc4588b1b134cb66b9e0842b96f0be96b724a049 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 17 Dec 2021 19:29:20 +0100 Subject: chore: add a comment form to posts --- src/components/Buttons/Button/Button.tsx | 2 +- src/components/CommentForm/CommentForm.tsx | 58 ++++++++++++++++++++++++++++++ src/pages/article/[slug].tsx | 3 ++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 src/components/CommentForm/CommentForm.tsx (limited to 'src') diff --git a/src/components/Buttons/Button/Button.tsx b/src/components/Buttons/Button/Button.tsx index c186d2a..8256e6b 100644 --- a/src/components/Buttons/Button/Button.tsx +++ b/src/components/Buttons/Button/Button.tsx @@ -9,7 +9,7 @@ const Button = ({ }: { children: ReactNode; clickHandler: any; - isDisabled: boolean; + isDisabled?: boolean; isPrimary?: boolean; }) => { const classes = `${styles.btn} ${ diff --git a/src/components/CommentForm/CommentForm.tsx b/src/components/CommentForm/CommentForm.tsx new file mode 100644 index 0000000..be6f5a6 --- /dev/null +++ b/src/components/CommentForm/CommentForm.tsx @@ -0,0 +1,58 @@ +import { ButtonSubmit } from '@components/Buttons'; +import { Form, FormItem, Input, TextArea } from '@components/Form'; +import { t } from '@lingui/macro'; +import { useState } from 'react'; + +const CommentForm = () => { + const [name, setName] = useState(''); + const [email, setEmail] = useState(''); + const [website, setWebsite] = useState(''); + const [message, setMessage] = useState(''); + + return ( +
+ + + + + + + + + + +