Add help tip notice to input

This commit is contained in:
Rafael 2022-02-07 10:37:19 -03:00 committed by Thomas Zarebczan
parent 83a535928d
commit 6bb7a155cd
4 changed files with 30 additions and 2 deletions

View file

@ -42,7 +42,7 @@ export const HelpText = (helpTextProps: HelpTextProps) => {
{deletedComment && <div className="error__text">{__('This comment has been deleted.')}</div>}
{!!minAmount && (
<div className="help--notice commentCreate__minAmountNotice">
<div className="help--notice comment-create__min-amount-notice">
<I18nMessage tokens={{ lbc: <CreditAmount noFormat amount={minAmount} /> }}>
{minTip ? 'Comment min: %lbc%' : minSuper ? 'HyperChat min: %lbc%' : ''}
</I18nMessage>

View file

@ -533,6 +533,11 @@ export function CommentCreate(props: Props) {
disabled={isFetchingChannels || disableInput}
isLivestream={isLivestream}
label={<FormChannelSelector isReply={Boolean(isReply)} isLivestream={Boolean(isLivestream)} />}
noticeLabel={
isMobile && (
<HelpText deletedComment={deletedComment} minAmount={minAmount} minSuper={minSuper} minTip={minTip} />
)
}
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) && (
<div className="section__actions">
{/* Submit Button */}
{isReviewingSupportComment ? (

View file

@ -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<Props, State> {
showSelectors,
submitButtonRef,
tipModalOpen,
noticeLabel,
quickActionHandler,
setShowSelectors,
render,
@ -282,6 +284,8 @@ export class FormField extends React.PureComponent<Props, State> {
</div>
)}
{noticeLabel}
{hideSuggestions ? (
<textarea
type={type}

View file

@ -45,6 +45,12 @@
.MuiOutlinedInput-root {
padding: 0px var(--spacing-xxs) !important;
}
@media (max-width: $breakpoint-small) {
.MuiOutlinedInput-notchedOutline {
display: none;
}
}
}
@media (min-width: $breakpoint-small) {
@ -53,6 +59,19 @@
}
}
.MuiDrawer-root {
.comment-create__min-amount-notice {
margin: 0px;
padding: var(--spacing-xxs);
}
}
.card--enable-overflow {
.comment-create__min-amount-notice {
margin-bottom: var(--spacing-xxs);
}
}
.comment-create--drawer .MuiOutlinedInput-notchedOutline {
border: 1px solid var(--color-border) !important;
border-radius: 0 !important;