From 42510c0515845c3376e68c5b6a1e112500fc072a Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 18 Jun 2025 23:36:37 +0300 Subject: gate notification settings (#8527) --- src/lib/statsig/gates.ts | 1 + .../components/PreferenceControls.tsx | 5 +++++ src/screens/Settings/Settings.tsx | 20 ++++++++++++-------- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/lib/statsig/gates.ts b/src/lib/statsig/gates.ts index 3b1106480..fca3f609a 100644 --- a/src/lib/statsig/gates.ts +++ b/src/lib/statsig/gates.ts @@ -7,6 +7,7 @@ export type Gate = | 'old_postonboarding' | 'onboarding_add_video_feed' | 'post_threads_v2_unspecced' + | 'reengagement_features' | 'remove_show_latest_button' | 'test_gate_1' | 'test_gate_2' diff --git a/src/screens/Settings/NotificationSettings/components/PreferenceControls.tsx b/src/screens/Settings/NotificationSettings/components/PreferenceControls.tsx index 8d80e4ed3..487827d66 100644 --- a/src/screens/Settings/NotificationSettings/components/PreferenceControls.tsx +++ b/src/screens/Settings/NotificationSettings/components/PreferenceControls.tsx @@ -5,6 +5,7 @@ import {type FilterablePreference} from '@atproto/api/dist/client/types/app/bsky import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {useGate} from '#/lib/statsig/statsig' import {useNotificationSettingsUpdateMutation} from '#/state/queries/notifications/settings' import {atoms as a, platform, useTheme} from '#/alf' import * as Toggle from '#/components/forms/Toggle' @@ -27,6 +28,10 @@ export function PreferenceControls({ preference?: AppBskyNotificationDefs.Preference | FilterablePreference allowDisableInApp?: boolean }) { + const gate = useGate() + + if (!gate('reengagement_features')) return null + if (!preference) return ( diff --git a/src/screens/Settings/Settings.tsx b/src/screens/Settings/Settings.tsx index 6310c7c3c..e1d197070 100644 --- a/src/screens/Settings/Settings.tsx +++ b/src/screens/Settings/Settings.tsx @@ -16,6 +16,7 @@ import { type CommonNavigatorParams, type NavigationProp, } from '#/lib/routes/types' +import {useGate} from '#/lib/statsig/statsig' import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' import {useProfileShadow} from '#/state/cache/profile-shadow' @@ -81,6 +82,7 @@ export function SettingsScreen({}: Props) { const {pendingDid, onPressSwitchAccount} = useAccountSwitcher() const [showAccounts, setShowAccounts] = useState(false) const [showDevOptions, setShowDevOptions] = useState(false) + const gate = useGate() return ( @@ -181,14 +183,16 @@ export function SettingsScreen({}: Props) { Moderation - - - - Notifications - - + {gate('reengagement_features') && ( + + + + Notifications + + + )} -- cgit 1.4.1