21989b558b
* add mockup screen * add notification index screen * add redirect screen * upgrade sdk * new icons * add new screens * make router typesafe, finish adding screens * add routes to go server * load settings * push notif settings * improve web * fix lockfile lint * no $type on preferences * prompt to enable push notifications * fix reply prefs * space out options * fix copy error * Update RepostsOnRepostsNotificationSettings.tsx * only send minimal diff to putPrefs * fix yarn.lock * Update Navigation.tsx Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * Update src/screens/Settings/NotificationSettings/index.tsx Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * add description to `syncOthers` --------- Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
67 lines
2.1 KiB
TypeScript
67 lines
2.1 KiB
TypeScript
import {View} from 'react-native'
|
|
import {Trans} from '@lingui/macro'
|
|
|
|
import {
|
|
type AllNavigatorParams,
|
|
type NativeStackScreenProps,
|
|
} from '#/lib/routes/types'
|
|
import {useNotificationSettingsQuery} from '#/state/queries/notifications/settings'
|
|
import {atoms as a} from '#/alf'
|
|
import {Admonition} from '#/components/Admonition'
|
|
import {Bubble_Stroke2_Corner2_Rounded as BubbleIcon} from '#/components/icons/Bubble'
|
|
import * as Layout from '#/components/Layout'
|
|
import * as SettingsList from '../components/SettingsList'
|
|
import {ItemTextWithSubtitle} from './components/ItemTextWithSubtitle'
|
|
import {PreferenceControls} from './components/PreferenceControls'
|
|
|
|
type Props = NativeStackScreenProps<
|
|
AllNavigatorParams,
|
|
'ReplyNotificationSettings'
|
|
>
|
|
export function ReplyNotificationSettingsScreen({}: Props) {
|
|
const {data: preferences, isError} = useNotificationSettingsQuery()
|
|
|
|
return (
|
|
<Layout.Screen>
|
|
<Layout.Header.Outer>
|
|
<Layout.Header.BackButton />
|
|
<Layout.Header.Content>
|
|
<Layout.Header.TitleText>
|
|
<Trans>Notifications</Trans>
|
|
</Layout.Header.TitleText>
|
|
</Layout.Header.Content>
|
|
<Layout.Header.Slot />
|
|
</Layout.Header.Outer>
|
|
<Layout.Content>
|
|
<SettingsList.Container>
|
|
<SettingsList.Item style={[a.align_start]}>
|
|
<SettingsList.ItemIcon icon={BubbleIcon} />
|
|
<ItemTextWithSubtitle
|
|
bold
|
|
titleText={<Trans>Replies</Trans>}
|
|
subtitleText={
|
|
<Trans>
|
|
Get notifications when people reply to your posts.
|
|
</Trans>
|
|
}
|
|
/>
|
|
</SettingsList.Item>
|
|
{isError ? (
|
|
<View style={[a.px_lg, a.pt_md]}>
|
|
<Admonition type="error">
|
|
<Trans>Failed to load notification settings.</Trans>
|
|
</Admonition>
|
|
</View>
|
|
) : (
|
|
<PreferenceControls
|
|
name="reply"
|
|
preference={preferences?.reply}
|
|
allowDisableInApp={false}
|
|
/>
|
|
)}
|
|
</SettingsList.Container>
|
|
</Layout.Content>
|
|
</Layout.Screen>
|
|
)
|
|
}
|