forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {View} from 'react-native'
2import {Trans} from '@lingui/macro'
3
4import {
5 type AllNavigatorParams,
6 type NativeStackScreenProps,
7} from '#/lib/routes/types'
8import {useNotificationSettingsQuery} from '#/state/queries/notifications/settings'
9import {atoms as a} from '#/alf'
10import {Admonition} from '#/components/Admonition'
11import {Repost_Stroke2_Corner2_Rounded as RepostIcon} from '#/components/icons/Repost'
12import * as Layout from '#/components/Layout'
13import * as SettingsList from '../components/SettingsList'
14import {ItemTextWithSubtitle} from './components/ItemTextWithSubtitle'
15import {PreferenceControls} from './components/PreferenceControls'
16
17type Props = NativeStackScreenProps<
18 AllNavigatorParams,
19 'RepostNotificationSettings'
20>
21export function RepostNotificationSettingsScreen({}: Props) {
22 const {data: preferences, isError} = useNotificationSettingsQuery()
23
24 return (
25 <Layout.Screen>
26 <Layout.Header.Outer>
27 <Layout.Header.BackButton />
28 <Layout.Header.Content>
29 <Layout.Header.TitleText>
30 <Trans>Notifications</Trans>
31 </Layout.Header.TitleText>
32 </Layout.Header.Content>
33 <Layout.Header.Slot />
34 </Layout.Header.Outer>
35 <Layout.Content>
36 <SettingsList.Container>
37 <SettingsList.Item style={[a.align_start]}>
38 <SettingsList.ItemIcon icon={RepostIcon} />
39 <ItemTextWithSubtitle
40 bold
41 titleText={<Trans>Reskeets</Trans>}
42 subtitleText={
43 <Trans>Get notifications when people reskeet your skeets.</Trans>
44 }
45 />
46 </SettingsList.Item>
47 {isError ? (
48 <View style={[a.px_lg, a.pt_md]}>
49 <Admonition type="error">
50 <Trans>Failed to load notification settings.</Trans>
51 </Admonition>
52 </View>
53 ) : (
54 <PreferenceControls
55 name="repost"
56 preference={preferences?.repost}
57 />
58 )}
59 </SettingsList.Container>
60 </Layout.Content>
61 </Layout.Screen>
62 )
63}