Reorg
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
* Keep this file separate to avoid import issues.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {Nux} from '#/state/queries/nuxs'
|
||||||
|
|
||||||
|
export const ID = Nux.BlockingAnnouncementPolicyUpdate202508
|
||||||
+6
-6
@@ -25,33 +25,33 @@ export function Announcement({state}: {state: AnnouncementState}) {
|
|||||||
const linkStyle = [a.text_md]
|
const linkStyle = [a.text_md]
|
||||||
const links = {
|
const links = {
|
||||||
terms: {
|
terms: {
|
||||||
overridePresentation: true,
|
overridePresentation: false,
|
||||||
to: `https://bsky.social/about/support`,
|
to: `https://bsky.social/about/support`,
|
||||||
label: _(msg`Terms of Service`),
|
label: _(msg`Terms of Service`),
|
||||||
},
|
},
|
||||||
privacy: {
|
privacy: {
|
||||||
overridePresentation: true,
|
overridePresentation: false,
|
||||||
to: `https://bsky.social/about/support`,
|
to: `https://bsky.social/about/support`,
|
||||||
label: _(msg`Privacy Policy`),
|
label: _(msg`Privacy Policy`),
|
||||||
},
|
},
|
||||||
copyright: {
|
copyright: {
|
||||||
overridePresentation: true,
|
overridePresentation: false,
|
||||||
to: `https://bsky.social/about/support`,
|
to: `https://bsky.social/about/support`,
|
||||||
label: _(msg`Copyright Policy`),
|
label: _(msg`Copyright Policy`),
|
||||||
},
|
},
|
||||||
guidelines: {
|
guidelines: {
|
||||||
overridePresentation: true,
|
overridePresentation: false,
|
||||||
to: `https://bsky.social/about/support`,
|
to: `https://bsky.social/about/support`,
|
||||||
label: _(msg`Community Guidelines`),
|
label: _(msg`Community Guidelines`),
|
||||||
},
|
},
|
||||||
blog: {
|
blog: {
|
||||||
overridePresentation: true,
|
overridePresentation: false,
|
||||||
to: `https://bsky.social/about/support`,
|
to: `https://bsky.social/about/support`,
|
||||||
label: _(msg`Our blog post`),
|
label: _(msg`Our blog post`),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
const linkButtonStyles = {
|
const linkButtonStyles = {
|
||||||
overridePresentation: true,
|
overridePresentation: false,
|
||||||
color: 'secondary',
|
color: 'secondary',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
} as const
|
} as const
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
import {Nux} from '#/state/queries/nuxs'
|
import {ID} from '#/components/dialogs/BlockingAnnouncements/announcements/PolicyUpdate202508/config'
|
||||||
|
|
||||||
export const ACTIVE_ANNOUNCEMENT = Nux.BlockingAnnouncementPolicyUpdate202508
|
/**
|
||||||
|
* The singulary active announcement ID. This is configured here to ensure that
|
||||||
|
* the relationship is clear.
|
||||||
|
*/
|
||||||
|
export const ACTIVE_ANNOUNCEMENT = ID
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {useMemo} from 'react'
|
import {useMemo} from 'react'
|
||||||
import {Platform} from 'react-native'
|
import {Platform, View} from 'react-native'
|
||||||
import {setStringAsync} from 'expo-clipboard'
|
import {setStringAsync} from 'expo-clipboard'
|
||||||
import * as FileSystem from 'expo-file-system'
|
import * as FileSystem from 'expo-file-system'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
@@ -12,10 +12,12 @@ import {Statsig} from 'statsig-react-native-expo'
|
|||||||
import {STATUS_PAGE_URL} from '#/lib/constants'
|
import {STATUS_PAGE_URL} from '#/lib/constants'
|
||||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||||
import {isAndroid, isIOS, isNative} from '#/platform/detection'
|
import {isAndroid, isIOS, isNative} from '#/platform/detection'
|
||||||
import {Nux} from '#/state/queries/nuxs'
|
|
||||||
import {useAgent} from '#/state/session'
|
import {useAgent} from '#/state/session'
|
||||||
import * as Toast from '#/view/com/util/Toast'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
import * as SettingsList from '#/screens/Settings/components/SettingsList'
|
import * as SettingsList from '#/screens/Settings/components/SettingsList'
|
||||||
|
import {atoms as a} from '#/alf'
|
||||||
|
import {Button, ButtonText} from '#/components/Button'
|
||||||
|
import {ID as PolicyUpdate202508} from '#/components/dialogs/BlockingAnnouncements/announcements/PolicyUpdate202508/config'
|
||||||
import {Atom_Stroke2_Corner0_Rounded as AtomIcon} from '#/components/icons/Atom'
|
import {Atom_Stroke2_Corner0_Rounded as AtomIcon} from '#/components/icons/Atom'
|
||||||
import {BroomSparkle_Stroke2_Corner2_Rounded as BroomSparkleIcon} from '#/components/icons/BroomSparkle'
|
import {BroomSparkle_Stroke2_Corner2_Rounded as BroomSparkleIcon} from '#/components/icons/BroomSparkle'
|
||||||
import {CodeLines_Stroke2_Corner2_Rounded as CodeLinesIcon} from '#/components/icons/CodeLines'
|
import {CodeLines_Stroke2_Corner2_Rounded as CodeLinesIcon} from '#/components/icons/CodeLines'
|
||||||
@@ -24,6 +26,7 @@ import {Newspaper_Stroke2_Corner2_Rounded as NewspaperIcon} from '#/components/i
|
|||||||
import {Wrench_Stroke2_Corner2_Rounded as WrenchIcon} from '#/components/icons/Wrench'
|
import {Wrench_Stroke2_Corner2_Rounded as WrenchIcon} from '#/components/icons/Wrench'
|
||||||
import * as Layout from '#/components/Layout'
|
import * as Layout from '#/components/Layout'
|
||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
|
import {Text} from '#/components/Typography'
|
||||||
import * as env from '#/env'
|
import * as env from '#/env'
|
||||||
import {device, useStorage} from '#/storage'
|
import {device, useStorage} from '#/storage'
|
||||||
import {useDemoMode} from '#/storage/hooks/demo-mode'
|
import {useDemoMode} from '#/storage/hooks/demo-mode'
|
||||||
@@ -200,32 +203,39 @@ function PolicyUpdateDebug() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SettingsList.PressableItem
|
<SettingsList.Divider />
|
||||||
onPress={() => {
|
<View style={[a.p_xl, a.gap_md]}>
|
||||||
setOverride(!override)
|
<Text style={[a.text_lg, a.font_bold]}>PolicyUpdate202508 Debug</Text>
|
||||||
}}
|
|
||||||
label="Toggle">
|
|
||||||
<SettingsList.ItemIcon icon={AtomIcon} />
|
|
||||||
<SettingsList.ItemText>
|
|
||||||
Enable policy update override
|
|
||||||
</SettingsList.ItemText>
|
|
||||||
</SettingsList.PressableItem>
|
|
||||||
|
|
||||||
{override && (
|
<View style={[a.flex_row, a.align_center, a.justify_between, a.gap_md]}>
|
||||||
<SettingsList.PressableItem
|
<Button
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
device.set([Nux.BlockingAnnouncementPolicyUpdate202508], false)
|
setOverride(!override)
|
||||||
agent.bskyAppRemoveNuxs([
|
}}
|
||||||
Nux.BlockingAnnouncementPolicyUpdate202508,
|
label="Toggle"
|
||||||
])
|
color={override ? 'primary' : 'secondary'}
|
||||||
}}
|
size="small"
|
||||||
label="Reset policy update nux">
|
style={[a.flex_1]}>
|
||||||
<SettingsList.ItemIcon icon={AtomIcon} />
|
<ButtonText>
|
||||||
<SettingsList.ItemText>
|
{override ? 'Disable debug mode' : 'Enable debug mode'}
|
||||||
Reset policy update state
|
</ButtonText>
|
||||||
</SettingsList.ItemText>
|
</Button>
|
||||||
</SettingsList.PressableItem>
|
|
||||||
)}
|
<Button
|
||||||
|
onPress={() => {
|
||||||
|
device.set([PolicyUpdate202508], false)
|
||||||
|
agent.bskyAppRemoveNuxs([PolicyUpdate202508])
|
||||||
|
Toast.show(`Done`, 'info')
|
||||||
|
}}
|
||||||
|
label="Reset policy update nux"
|
||||||
|
color="secondary"
|
||||||
|
size="small"
|
||||||
|
disabled={!override}>
|
||||||
|
<ButtonText>Reset state</ButtonText>
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<SettingsList.Divider />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {type Nux} from '#/state/queries/nuxs'
|
import {type ID as PolicyUpdate202508} from '#/components/dialogs/BlockingAnnouncements/announcements/PolicyUpdate202508/config'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Device data that's specific to the device and does not vary based account
|
* Device data that's specific to the device and does not vary based account
|
||||||
@@ -20,7 +20,7 @@ export type Device = {
|
|||||||
* Blocking announcements. New IDs are required for each new announcement.
|
* Blocking announcements. New IDs are required for each new announcement.
|
||||||
*/
|
*/
|
||||||
blockingAnnouncementOverride?: boolean
|
blockingAnnouncementOverride?: boolean
|
||||||
[Nux.BlockingAnnouncementPolicyUpdate202508]?: boolean
|
[PolicyUpdate202508]?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Account = {
|
export type Account = {
|
||||||
|
|||||||
Reference in New Issue
Block a user