diff --git a/src/components/Article/CommentsTree.tsx b/src/components/Article/CommentsTree.tsx index 8ed6fae2..e8acc1fa 100644 --- a/src/components/Article/CommentsTree.tsx +++ b/src/components/Article/CommentsTree.tsx @@ -68,7 +68,9 @@ export const CommentsTree = (props: Props) => { setCookie() } }) + const [posting, setPosting] = createSignal(false) const handleSubmitComment = async (value: string) => { + setPosting(true) try { await createReaction({ kind: ReactionKind.Comment, @@ -81,6 +83,7 @@ export const CommentsTree = (props: Props) => { console.error('[handleCreate reaction]:', error) } setClearEditor(false) + setPosting(false) } return ( @@ -158,6 +161,7 @@ export const CommentsTree = (props: Props) => { placeholder={t('Write a comment...')} onSubmit={(value) => handleSubmitComment(value)} setClear={clearEditor()} + isPosting={posting()} /> diff --git a/src/components/Editor/SimplifiedEditor.tsx b/src/components/Editor/SimplifiedEditor.tsx index 44401b1c..187fe25f 100644 --- a/src/components/Editor/SimplifiedEditor.tsx +++ b/src/components/Editor/SimplifiedEditor.tsx @@ -36,6 +36,7 @@ import { UploadModalContent } from './UploadModalContent' import { Figcaption } from './extensions/Figcaption' import { Figure } from './extensions/Figure' +import { Loading } from '../_shared/Loading' import styles from './SimplifiedEditor.module.scss' type Props = { @@ -58,6 +59,7 @@ type Props = { controlsAlwaysVisible?: boolean autoFocus?: boolean isCancelButtonVisible?: boolean + isPosting?: boolean } const DEFAULT_MAX_LENGTH = 400 @@ -365,12 +367,14 @@ const SimplifiedEditor = (props: Props) => {