From 81bac22fe002dea97196836e5adb4fe8a64ed9f6 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 18 Jul 2021 21:04:28 +0200 Subject: [PATCH] disable review button if no card saved also some cleanup --- ui/component/commentCreate/view.jsx | 11 +++---- ui/component/walletSendTip/view.jsx | 4 +-- ui/component/walletTipAmountSelector/view.jsx | 30 +++++++++++-------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx index 6be016f43..12028b6de 100644 --- a/ui/component/commentCreate/view.jsx +++ b/ui/component/commentCreate/view.jsx @@ -84,16 +84,14 @@ export function CommentCreate(props: Props) { const [commentValue, setCommentValue] = React.useState(''); const [advancedEditor, setAdvancedEditor] = usePersistedState('comment-editor-mode', false); const hasChannels = channels && channels.length; - const disabled = isSubmitting || !activeChannelClaim || !commentValue.length; const charCount = commentValue.length; const [activeTab, setActiveTab] = React.useState(''); const [tipError, setTipError] = React.useState(); - // React.useEffect(() => { - // setTipError('yes'); - // }, []); + const disabled = isSubmitting || !activeChannelClaim || !commentValue.length; + const [shouldDisableReviewButton, setShouldDisableReviewButton] = React.useState(); function handleCommentChange(event) { let commentValue; @@ -373,10 +371,10 @@ export function CommentCreate(props: Props) { autoFocus={isReply} textAreaMaxLength={livestream ? FF_MAX_CHARS_IN_LIVESTREAM_COMMENT : FF_MAX_CHARS_IN_COMMENT} /> - {/* TODO: the tip validation is done in selector */} {isSupportComment && (