diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-06-17 12:37:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-17 02:37:14 -0700 |
commit | 21989b558bd074bf84ac08c174d7a411fda1ffb7 (patch) | |
tree | f5f28510cf5a592b83bcfc581a57e992823eb402 /src/screens/Settings/NotificationSettings/LikesOnRepostsNotificationSettings.tsx | |
parent | 7dc6bb57a6666db3e507630c13448487acceadc5 (diff) | |
download | voidsky-21989b558bd074bf84ac08c174d7a411fda1ffb7.tar.zst |
Granular notification settings (#8484)
* 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>
Diffstat (limited to 'src/screens/Settings/NotificationSettings/LikesOnRepostsNotificationSettings.tsx')
-rw-r--r-- | src/screens/Settings/NotificationSettings/LikesOnRepostsNotificationSettings.tsx | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/screens/Settings/NotificationSettings/LikesOnRepostsNotificationSettings.tsx b/src/screens/Settings/NotificationSettings/LikesOnRepostsNotificationSettings.tsx new file mode 100644 index 000000000..08a05d468 --- /dev/null +++ b/src/screens/Settings/NotificationSettings/LikesOnRepostsNotificationSettings.tsx @@ -0,0 +1,65 @@ +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 {LikeRepost_Stroke2_Corner2_Rounded as LikeRepostIcon} from '#/components/icons/Heart2' +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, + 'LikesOnRepostsNotificationSettings' +> +export function LikesOnRepostsNotificationSettingsScreen({}: 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={LikeRepostIcon} /> + <ItemTextWithSubtitle + bold + titleText={<Trans>Likes on your reposts</Trans>} + subtitleText={ + <Trans> + Get notifications when people like posts that you've reposted. + </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="likeViaRepost" + preference={preferences?.likeViaRepost} + /> + )} + </SettingsList.Container> + </Layout.Content> + </Layout.Screen> + ) +} |