gate notification settings (#8527)
This commit is contained in:
@@ -7,6 +7,7 @@ export type Gate =
|
|||||||
| 'old_postonboarding'
|
| 'old_postonboarding'
|
||||||
| 'onboarding_add_video_feed'
|
| 'onboarding_add_video_feed'
|
||||||
| 'post_threads_v2_unspecced'
|
| 'post_threads_v2_unspecced'
|
||||||
|
| 'reengagement_features'
|
||||||
| 'remove_show_latest_button'
|
| 'remove_show_latest_button'
|
||||||
| 'test_gate_1'
|
| 'test_gate_1'
|
||||||
| 'test_gate_2'
|
| 'test_gate_2'
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {type FilterablePreference} from '@atproto/api/dist/client/types/app/bsky
|
|||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {useGate} from '#/lib/statsig/statsig'
|
||||||
import {useNotificationSettingsUpdateMutation} from '#/state/queries/notifications/settings'
|
import {useNotificationSettingsUpdateMutation} from '#/state/queries/notifications/settings'
|
||||||
import {atoms as a, platform, useTheme} from '#/alf'
|
import {atoms as a, platform, useTheme} from '#/alf'
|
||||||
import * as Toggle from '#/components/forms/Toggle'
|
import * as Toggle from '#/components/forms/Toggle'
|
||||||
@@ -27,6 +28,10 @@ export function PreferenceControls({
|
|||||||
preference?: AppBskyNotificationDefs.Preference | FilterablePreference
|
preference?: AppBskyNotificationDefs.Preference | FilterablePreference
|
||||||
allowDisableInApp?: boolean
|
allowDisableInApp?: boolean
|
||||||
}) {
|
}) {
|
||||||
|
const gate = useGate()
|
||||||
|
|
||||||
|
if (!gate('reengagement_features')) return null
|
||||||
|
|
||||||
if (!preference)
|
if (!preference)
|
||||||
return (
|
return (
|
||||||
<View style={[a.w_full, a.pt_5xl, a.align_center]}>
|
<View style={[a.w_full, a.pt_5xl, a.align_center]}>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
type CommonNavigatorParams,
|
type CommonNavigatorParams,
|
||||||
type NavigationProp,
|
type NavigationProp,
|
||||||
} from '#/lib/routes/types'
|
} from '#/lib/routes/types'
|
||||||
|
import {useGate} from '#/lib/statsig/statsig'
|
||||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||||
@@ -81,6 +82,7 @@ export function SettingsScreen({}: Props) {
|
|||||||
const {pendingDid, onPressSwitchAccount} = useAccountSwitcher()
|
const {pendingDid, onPressSwitchAccount} = useAccountSwitcher()
|
||||||
const [showAccounts, setShowAccounts] = useState(false)
|
const [showAccounts, setShowAccounts] = useState(false)
|
||||||
const [showDevOptions, setShowDevOptions] = useState(false)
|
const [showDevOptions, setShowDevOptions] = useState(false)
|
||||||
|
const gate = useGate()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout.Screen>
|
<Layout.Screen>
|
||||||
@@ -181,14 +183,16 @@ export function SettingsScreen({}: Props) {
|
|||||||
<Trans>Moderation</Trans>
|
<Trans>Moderation</Trans>
|
||||||
</SettingsList.ItemText>
|
</SettingsList.ItemText>
|
||||||
</SettingsList.LinkItem>
|
</SettingsList.LinkItem>
|
||||||
<SettingsList.LinkItem
|
{gate('reengagement_features') && (
|
||||||
to="/settings/notifications"
|
<SettingsList.LinkItem
|
||||||
label={_(msg`Notifications`)}>
|
to="/settings/notifications"
|
||||||
<SettingsList.ItemIcon icon={NotificationIcon} />
|
label={_(msg`Notifications`)}>
|
||||||
<SettingsList.ItemText>
|
<SettingsList.ItemIcon icon={NotificationIcon} />
|
||||||
<Trans>Notifications</Trans>
|
<SettingsList.ItemText>
|
||||||
</SettingsList.ItemText>
|
<Trans>Notifications</Trans>
|
||||||
</SettingsList.LinkItem>
|
</SettingsList.ItemText>
|
||||||
|
</SettingsList.LinkItem>
|
||||||
|
)}
|
||||||
<SettingsList.LinkItem
|
<SettingsList.LinkItem
|
||||||
to="/settings/content-and-media"
|
to="/settings/content-and-media"
|
||||||
label={_(msg`Content and media`)}>
|
label={_(msg`Content and media`)}>
|
||||||
|
|||||||
Reference in New Issue
Block a user