(
canDisplayAutoarchiveSetting: Boolean(appConfig?.canDisplayAutoarchiveSetting),
shouldArchiveAndMuteNewNonContact,
canChangeSensitive,
+ shouldNewNonContactPeersRequirePremium,
privacyPhoneNumber: privacy.phoneNumber,
privacyLastSeen: privacy.lastSeen,
privacyProfilePhoto: privacy.profilePhoto,
diff --git a/src/components/left/settings/SettingsPrivacyLastSeen.module.scss b/src/components/left/settings/SettingsPrivacyLastSeen.module.scss
deleted file mode 100644
index 898838f0b..000000000
--- a/src/components/left/settings/SettingsPrivacyLastSeen.module.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-:global(.settings-item-description-larger).premiumInfo {
- margin-top: 1rem;
-}
diff --git a/src/components/left/settings/SettingsPrivacyLastSeen.tsx b/src/components/left/settings/SettingsPrivacyLastSeen.tsx
index 96964dbeb..ff7c90e0f 100644
--- a/src/components/left/settings/SettingsPrivacyLastSeen.tsx
+++ b/src/components/left/settings/SettingsPrivacyLastSeen.tsx
@@ -4,7 +4,6 @@ import { getActions, withGlobal } from '../../../global';
import type { PrivacyVisibility } from '../../../types';
import { selectIsCurrentUserPremium, selectShouldHideReadMarks } from '../../../global/selectors';
-import buildClassName from '../../../util/buildClassName';
import renderText from '../../common/helpers/renderText';
import useLang from '../../../hooks/useLang';
@@ -14,8 +13,6 @@ import PremiumIcon from '../../common/PremiumIcon';
import Checkbox from '../../ui/Checkbox';
import ListItem from '../../ui/ListItem';
-import styles from './SettingsPrivacyLastSeen.module.scss';
-
type OwnProps = {
visibility?: PrivacyVisibility;
};
@@ -59,10 +56,7 @@ const SettingsPrivacyLastSeen = ({
{isCurrentUserPremium ? lang('PrivacyLastSeenPremiumForPremium') : lang('PrivacyLastSeenPremium')}
{isCurrentUserPremium
diff --git a/src/components/left/settings/SettingsPrivacyVisibility.tsx b/src/components/left/settings/SettingsPrivacyVisibility.tsx
index 16556552a..e3042ecca 100644
--- a/src/components/left/settings/SettingsPrivacyVisibility.tsx
+++ b/src/components/left/settings/SettingsPrivacyVisibility.tsx
@@ -6,7 +6,7 @@ import type { ApiPhoto } from '../../../api/types';
import type { ApiPrivacySettings } from '../../../types';
import { SettingsScreens } from '../../../types';
-import { selectUserFullInfo } from '../../../global/selectors';
+import { selectIsCurrentUserPremium, selectUserFullInfo } from '../../../global/selectors';
import { getPrivacyKey } from './helpers/privacy';
import useHistoryBack from '../../../hooks/useHistoryBack';
@@ -15,6 +15,8 @@ import useLastCallback from '../../../hooks/useLastCallback';
import ListItem from '../../ui/ListItem';
import RadioGroup from '../../ui/RadioGroup';
+import PremiumStatusItem from './PremiumStatusItem';
+import PrivacyLockedOption from './PrivacyLockedOption';
import SettingsPrivacyLastSeen from './SettingsPrivacyLastSeen';
import SettingsPrivacyPublicProfilePhoto from './SettingsPrivacyPublicProfilePhoto';
@@ -31,6 +33,7 @@ type StateProps = {
currentUserFallbackPhoto?: ApiPhoto;
primaryPrivacy?: ApiPrivacySettings;
secondaryPrivacy?: ApiPrivacySettings;
+ isPremiumRequired?: boolean;
};
const SettingsPrivacyVisibility: FC = ({
@@ -41,6 +44,7 @@ const SettingsPrivacyVisibility: FC = ({
currentUserId,
hasCurrentUserFullInfo,
currentUserFallbackPhoto,
+ isPremiumRequired,
onScreenSelect,
onReset,
}) => {
@@ -67,6 +71,7 @@ const SettingsPrivacyVisibility: FC = ({
screen={screen}
privacy={primaryPrivacy}
onScreenSelect={onScreenSelect}
+ isPremiumRequired={isPremiumRequired}
/>
{screen === SettingsScreens.PrivacyProfilePhoto && primaryPrivacy?.visibility !== 'everybody' && (
void;
}) {
const { setPrivacyVisibility } = getActions();
@@ -105,13 +112,30 @@ function PrivacySubsection({
const hasNobody = screen !== SettingsScreens.PrivacyAddByPhone;
const options = [
{ value: 'everybody', label: lang('P2PEverybody') },
- { value: 'contacts', label: lang('P2PContacts') },
+ {
+ value: 'contacts',
+ label: isPremiumRequired ? (
+
+ ) : (
+ lang('P2PContacts')
+ ),
+ hidden: isPremiumRequired,
+ },
];
+
if (hasNobody) {
- options.push({ value: 'nobody', label: lang('P2PNobody') });
+ options.push({
+ value: 'nobody',
+ label: isPremiumRequired ? (
+
+ ) : (
+ lang('P2PNobody')
+ ),
+ hidden: isPremiumRequired,
+ });
}
return options;
- }, [lang, screen]);
+ }, [lang, screen, isPremiumRequired]);
const primaryExceptionLists = useMemo(() => {
if (screen === SettingsScreens.PrivacyAddByPhone) {
@@ -136,6 +160,8 @@ function PrivacySubsection({
case SettingsScreens.PrivacyAddByPhone: {
return privacy?.visibility === 'everybody' ? lang('PrivacyPhoneInfo') : lang('PrivacyPhoneInfo3');
}
+ case SettingsScreens.PrivacyVoiceMessages:
+ return lang('PrivacyVoiceMessagesInfo');
default:
return undefined;
}
@@ -257,7 +283,7 @@ function PrivacySubsection({
{descriptionText}
)}
- {(primaryExceptionLists.shouldShowAllowed || primaryExceptionLists.shouldShowDenied) && (
+ {!isPremiumRequired && (primaryExceptionLists.shouldShowAllowed || primaryExceptionLists.shouldShowDenied) && (
{lang('PrivacyExceptions')}
@@ -294,6 +320,7 @@ function PrivacySubsection({
)}
)}
+ {isPremiumRequired && }
>
);
}
@@ -361,6 +388,7 @@ export default memo(withGlobal(
currentUserId: currentUserId!,
hasCurrentUserFullInfo: Boolean(currentUserFullInfo),
currentUserFallbackPhoto: currentUserFullInfo?.fallbackPhoto,
+ isPremiumRequired: screen === SettingsScreens.PrivacyVoiceMessages && !selectIsCurrentUserPremium(global),
};
},
)(SettingsPrivacyVisibility));
diff --git a/src/components/ui/Radio.tsx b/src/components/ui/Radio.tsx
index 5747beba5..a1688c713 100644
--- a/src/components/ui/Radio.tsx
+++ b/src/components/ui/Radio.tsx
@@ -20,6 +20,7 @@ type OwnProps = {
disabled?: boolean;
hidden?: boolean;
isLoading?: boolean;
+ className?: string;
onChange: (e: ChangeEvent) => void;
};
@@ -33,18 +34,20 @@ const Radio: FC = ({
disabled,
hidden,
isLoading,
+ className,
onChange,
}) => {
const lang = useLang();
- const className = buildClassName(
+ const fullClassName = buildClassName(
'Radio',
+ className,
disabled && 'disabled',
hidden && 'hidden-widget',
isLoading && 'loading',
);
return (
-