diff --git a/src/components/comment/LocalCommentForm/index.tsx b/src/components/comment/LocalCommentForm/index.tsx index a2bb90db..d3dcac18 100644 --- a/src/components/comment/LocalCommentForm/index.tsx +++ b/src/components/comment/LocalCommentForm/index.tsx @@ -19,7 +19,7 @@ const LocalCommentForm: FC<IProps> = () => { return ( <form onSubmit={formik.handleSubmit}> <FormikProvider value={formik}> - <LocalCommentFormTextarea isLoading={formik.isSubmitting} setRef={setTextarea} /> + <LocalCommentFormTextarea setRef={setTextarea} /> {formik.isSubmitting && <div>LOADING</div>} {!!formik.status && <div>error: {formik.status}</div>} <Button size="small" disabled={formik.isSubmitting}> diff --git a/src/components/comment/LocalCommentFormTextarea/index.tsx b/src/components/comment/LocalCommentFormTextarea/index.tsx index 407c0311..79e4a524 100644 --- a/src/components/comment/LocalCommentFormTextarea/index.tsx +++ b/src/components/comment/LocalCommentFormTextarea/index.tsx @@ -8,8 +8,8 @@ interface IProps { setRef?: (r: HTMLTextAreaElement) => void; } -const LocalCommentFormTextarea: FC<IProps> = ({ isLoading, setRef }) => { - const { values, handleChange, handleSubmit } = useCommentFormContext(); +const LocalCommentFormTextarea: FC<IProps> = ({ setRef }) => { + const { values, handleChange, handleSubmit, isSubmitting } = useCommentFormContext(); const onKeyDown = useCallback<KeyboardEventHandler<HTMLTextAreaElement>>( ({ ctrlKey, key }) => { @@ -25,7 +25,7 @@ const LocalCommentFormTextarea: FC<IProps> = ({ isLoading, setRef }) => { value={values.text} handler={handleChange('text')} onKeyDown={onKeyDown} - disabled={isLoading} + disabled={isSubmitting} placeholder={placeholder} minRows={2} setRef={setRef}