From 6bb7a155cd957802c73d2c910604410ba007e22b Mon Sep 17 00:00:00 2001 From: Rafael Date: Mon, 7 Feb 2022 10:37:19 -0300 Subject: [PATCH] Add help tip notice to input --- ui/component/commentCreate/extra-contents.jsx | 2 +- ui/component/commentCreate/view.jsx | 7 ++++++- .../common/form-components/form-field.jsx | 4 ++++ ui/scss/component/_textarea-suggestions.scss | 19 +++++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ui/component/commentCreate/extra-contents.jsx b/ui/component/commentCreate/extra-contents.jsx index 746b6d662..2b468f44a 100644 --- a/ui/component/commentCreate/extra-contents.jsx +++ b/ui/component/commentCreate/extra-contents.jsx @@ -42,7 +42,7 @@ export const HelpText = (helpTextProps: HelpTextProps) => { {deletedComment &&
{__('This comment has been deleted.')}
} {!!minAmount && ( -
+
}}> {minTip ? 'Comment min: %lbc%' : minSuper ? 'HyperChat min: %lbc%' : ''} diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx index f7dda7b88..386e14c63 100644 --- a/ui/component/commentCreate/view.jsx +++ b/ui/component/commentCreate/view.jsx @@ -533,6 +533,11 @@ export function CommentCreate(props: Props) { disabled={isFetchingChannels || disableInput} isLivestream={isLivestream} label={} + noticeLabel={ + isMobile && ( + + ) + } name={isReply ? 'create__reply' : 'create__comment'} onChange={(e) => setCommentValue(SIMPLE_SITE || !advancedEditor || isReply ? e.target.value : e)} handleTip={(isLBC) => handleSelectTipComment(isLBC ? TAB_LBC : TAB_FIAT)} @@ -574,7 +579,7 @@ export function CommentCreate(props: Props) { /> )} - {(!isMobile || !isLivestream || isReviewingStickerComment || isReviewingSupportComment) && ( + {(!isMobile || isReviewingStickerComment || isReviewingSupportComment) && (
{/* Submit Button */} {isReviewingSupportComment ? ( diff --git a/ui/component/common/form-components/form-field.jsx b/ui/component/common/form-components/form-field.jsx index 9de7da802..f33928704 100644 --- a/ui/component/common/form-components/form-field.jsx +++ b/ui/component/common/form-components/form-field.jsx @@ -49,6 +49,7 @@ type Props = { showSelectors?: boolean, submitButtonRef?: any, tipModalOpen?: boolean, + noticeLabel?: any, onChange?: (any) => any, setShowSelectors?: (boolean) => void, quickActionHandler?: (any) => any, @@ -117,6 +118,7 @@ export class FormField extends React.PureComponent { showSelectors, submitButtonRef, tipModalOpen, + noticeLabel, quickActionHandler, setShowSelectors, render, @@ -282,6 +284,8 @@ export class FormField extends React.PureComponent {
)} + {noticeLabel} + {hideSuggestions ? (