diff --git a/assets/images/activity_notifications_announcement.png b/assets/images/activity_notifications_announcement.png new file mode 100644 index 0000000000..221297faac Binary files /dev/null and b/assets/images/activity_notifications_announcement.png differ diff --git a/src/components/dialogs/nuxs/ActivityNotificationsAnnouncement.tsx b/src/components/dialogs/nuxs/ActivityNotificationsAnnouncement.tsx new file mode 100644 index 0000000000..e4ae48b673 --- /dev/null +++ b/src/components/dialogs/nuxs/ActivityNotificationsAnnouncement.tsx @@ -0,0 +1,166 @@ +import {useCallback} from 'react' +import {View} from 'react-native' +import {Image} from 'expo-image' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' + +import {atoms as a, useBreakpoints, useTheme} from '#/alf' +import {Button, ButtonText} from '#/components/Button' +import * as Dialog from '#/components/Dialog' +import {useNuxDialogContext} from '#/components/dialogs/nuxs' +import {Sparkle_Stroke2_Corner0_Rounded as SparkleIcon} from '#/components/icons/Sparkle' +import {Link} from '#/components/Link' +import {Text} from '#/components/Typography' + +export function ActivityNotificationsAnnouncement() { + const t = useTheme() + const {_} = useLingui() + const {gtMobile} = useBreakpoints() + const nuxDialogs = useNuxDialogContext() + const control = Dialog.useDialogControl() + + Dialog.useAutoOpen(control) + + const onClose = useCallback(() => { + nuxDialogs.dismissActiveNux() + }, [nuxDialogs]) + + return ( + + + + + + + + + New Feature + + + + + + {_( + + + + + + Get notified when someone posts + + + + You can now choose to receive notifications for when specific + people make new posts. If there’s someone you want timely + updates from, go to their profile and find the new bell icon + near the follow button. + + + + + By default, only people you follow can subscribe to you. You can + change this in Settings. + + + + + + + { + control.close() + }}> + + Edit who can subscribe + + + + + + + + + ) +} diff --git a/src/components/dialogs/nuxs/index.tsx b/src/components/dialogs/nuxs/index.tsx index 11377e1ded..628813bc42 100644 --- a/src/components/dialogs/nuxs/index.tsx +++ b/src/components/dialogs/nuxs/index.tsx @@ -11,6 +11,7 @@ import { import {useProfileQuery} from '#/state/queries/profile' import {type SessionAccount, useSession} from '#/state/session' import {useOnboardingState} from '#/state/shell' +import {ActivityNotificationsAnnouncement} from '#/components/dialogs/nuxs/ActivityNotificationsAnnouncement' import {InitialVerificationAnnouncement} from '#/components/dialogs/nuxs/InitialVerificationAnnouncement' /* * NUXs @@ -32,8 +33,14 @@ const queuedNuxs: { preferences: UsePreferencesQueryResponse }) => boolean }[] = [ + // { + // id: Nux.InitialVerificationAnnouncement, + // enabled: ({currentProfile}) => { + // return isDaysOld(2, currentProfile.createdAt) + // }, + // }, { - id: Nux.InitialVerificationAnnouncement, + id: Nux.ActivityNotificationsAnnouncement, enabled: ({currentProfile}) => { return isDaysOld(2, currentProfile.createdAt) }, @@ -175,6 +182,9 @@ function Inner({ {activeNux === Nux.InitialVerificationAnnouncement && ( )} + {activeNux === Nux.ActivityNotificationsAnnouncement && ( + + )} ) } diff --git a/src/state/queries/nuxs/definitions.ts b/src/state/queries/nuxs/definitions.ts index a44ffa4c54..fbc240a7a6 100644 --- a/src/state/queries/nuxs/definitions.ts +++ b/src/state/queries/nuxs/definitions.ts @@ -6,6 +6,7 @@ export enum Nux { NeueTypography = 'NeueTypography', ExploreInterestsCard = 'ExploreInterestsCard', InitialVerificationAnnouncement = 'InitialVerificationAnnouncement', + ActivityNotificationsAnnouncement = 'ActivityNotificationsAnnouncement', } export const nuxNames = new Set(Object.values(Nux)) @@ -23,10 +24,15 @@ export type AppNux = BaseNux< id: Nux.InitialVerificationAnnouncement data: undefined } + | { + id: Nux.ActivityNotificationsAnnouncement + data: undefined + } > export const NuxSchemas: Record | undefined> = { [Nux.NeueTypography]: undefined, [Nux.ExploreInterestsCard]: undefined, [Nux.InitialVerificationAnnouncement]: undefined, + [Nux.ActivityNotificationsAnnouncement]: undefined, }