Allow adding tip to sticker chats

This commit is contained in:
Rafael 2022-02-07 10:13:21 -03:00 committed by Thomas Zarebczan
parent 9067a024ab
commit 83a535928d

View file

@ -156,7 +156,22 @@ export function CommentCreate(props: Props) {
function handleSelectTipComment(tab: string) { function handleSelectTipComment(tab: string) {
setActiveTab(tab); setActiveTab(tab);
setTipSelector(true);
if (isMobile) {
setTipModalOpen(true);
doOpenModal(MODALS.SEND_TIP, {
uri,
isTipOnly: true,
hasSelectedTab: tab,
customText: __('Preview Comment Tip'),
setAmount: (amount) => {
setTipAmount(amount);
setReviewingSupportComment(true);
},
});
} else {
setTipSelector(true);
}
} }
function handleStickerComment() { function handleStickerComment() {
@ -520,20 +535,7 @@ export function CommentCreate(props: Props) {
label={<FormChannelSelector isReply={Boolean(isReply)} isLivestream={Boolean(isLivestream)} />} label={<FormChannelSelector isReply={Boolean(isReply)} isLivestream={Boolean(isLivestream)} />}
name={isReply ? 'create__reply' : 'create__comment'} name={isReply ? 'create__reply' : 'create__comment'}
onChange={(e) => setCommentValue(SIMPLE_SITE || !advancedEditor || isReply ? e.target.value : e)} onChange={(e) => setCommentValue(SIMPLE_SITE || !advancedEditor || isReply ? e.target.value : e)}
handleTip={(isLBC) => { handleTip={(isLBC) => handleSelectTipComment(isLBC ? TAB_LBC : TAB_FIAT)}
setActiveTab(isLBC ? TAB_LBC : TAB_FIAT);
setTipModalOpen(true);
doOpenModal(MODALS.SEND_TIP, {
uri,
isTipOnly: true,
hasSelectedTab: isLBC ? TAB_LBC : TAB_FIAT,
customText: __('Preview Comment Tip'),
setAmount: (amount) => {
setTipAmount(amount);
setReviewingSupportComment(true);
},
});
}}
handleSubmit={handleCreateComment} handleSubmit={handleCreateComment}
slimInput={isMobile} slimInput={isMobile}
commentSelectorsProps={commentSelectorsProps} commentSelectorsProps={commentSelectorsProps}
@ -619,22 +621,20 @@ export function CommentCreate(props: Props) {
)} )}
{!isMobile && ( {!isMobile && (
<StickerActionButton
{...actionButtonProps}
isReviewingStickerComment={isReviewingStickerComment}
icon={ICONS.STICKER}
onClick={handleStickerComment}
/>
)}
{(!isMobile || isReviewingStickerComment) && !supportDisabled && (
<> <>
<StickerActionButton <TipActionButton {...tipButtonProps} name={__('Credits')} icon={ICONS.LBC} tab={TAB_LBC} />
{...actionButtonProps}
isReviewingStickerComment={isReviewingStickerComment}
icon={ICONS.STICKER}
onClick={handleStickerComment}
/>
{!supportDisabled && ( {stripeEnvironment && (
<> <TipActionButton {...tipButtonProps} name={__('Cash')} icon={ICONS.FINANCE} tab={TAB_FIAT} />
<TipActionButton {...tipButtonProps} name={__('Credits')} icon={ICONS.LBC} tab={TAB_LBC} />
{stripeEnvironment && (
<TipActionButton {...tipButtonProps} name={__('Cash')} icon={ICONS.FINANCE} tab={TAB_FIAT} />
)}
</>
)} )}
</> </>
)} )}