diff --git a/src/assets/localization/fallback.strings b/src/assets/localization/fallback.strings index 5e44b030b..110abf7f9 100644 --- a/src/assets/localization/fallback.strings +++ b/src/assets/localization/fallback.strings @@ -1931,6 +1931,7 @@ "DescriptionRestrictedMedia" = "Posting media content is not allowed in this group."; "DescriptionScheduledPaidMediaNotAllowed" = "Posting scheduled paid media content is not allowed"; "DescriptionScheduledPaidMessagesNotAllowed" = "Scheduled paid messages is not allowed"; +"UnlockButtonTitle" = "Unlock with Telegram Premium"; "FrozenAccountModalTitle" = "Your Account is Frozen"; "FrozenAccountViolationTitle" = "Violation of Terms"; "FrozenAccountViolationSubtitle" = "Your account was frozen for breaking Telegram's Terms and Conditions"; diff --git a/src/components/left/settings/PrivacyMessages.tsx b/src/components/left/settings/PrivacyMessages.tsx index 8c94490dc..bc90e7b06 100644 --- a/src/components/left/settings/PrivacyMessages.tsx +++ b/src/components/left/settings/PrivacyMessages.tsx @@ -25,6 +25,7 @@ import useLastCallback from '../../../hooks/useLastCallback'; import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; +import Button from '../../ui/Button'; import ListItem from '../../ui/ListItem'; import RadioGroup from '../../ui/RadioGroup'; import RangeSlider from '../../ui/RangeSlider'; @@ -65,7 +66,7 @@ function PrivacyMessages({ onReset, onScreenSelect, }: OwnProps & StateProps) { - const { updateGlobalPrivacySettings } = getActions(); + const { updateGlobalPrivacySettings, openPremiumModal } = getActions(); const oldLang = useOldLang(); const lang = useLang(); @@ -139,9 +140,13 @@ function PrivacyMessages({ ); }, [lang, canChangeChargeForMessages]); + const handleUnlockWithPremium = useLastCallback(() => { + openPremiumModal({ initialSection: 'message_privacy' }); + }); + function renderSectionStarsAmountForPaidMessages() { return ( -
- {lang('SectionDescriptionStarsForForMessages', { - percent: starsPaidMessageCommissionPermille * 100, - amount: formatCurrencyAsString( - chargeForMessages * starsUsdWithdrawRate * starsPaidMessageCommissionPermille, - 'USD', - lang.code, + {!isCurrentUserPremium && ( +
+ + {lang('UnlockButtonTitle')} ++ {lang('SectionDescriptionStarsForForMessages', { + percent: starsPaidMessageCommissionPermille * 100, + amount: formatCurrencyAsString( + chargeForMessages * starsUsdWithdrawRate * starsPaidMessageCommissionPermille, + 'USD', + lang.code, + ), + }, { + withNodes: true, + })} +
+ )}