From f988adbc518237609aaff8ea076b27e5f6756665 Mon Sep 17 00:00:00 2001 From: Hailey Date: Tue, 18 Jun 2024 10:39:15 -0700 Subject: [PATCH] add a notice --- src/screens/Signup/index.tsx | 68 ++++++++++++++++++++++++++++++++- src/view/com/auth/LoggedOut.tsx | 2 +- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/src/screens/Signup/index.tsx b/src/screens/Signup/index.tsx index 2cc1bcab0b..58d252db46 100644 --- a/src/screens/Signup/index.tsx +++ b/src/screens/Signup/index.tsx @@ -1,6 +1,11 @@ import React from 'react' import {View} from 'react-native' -import {LayoutAnimationConfig} from 'react-native-reanimated' +import Animated, { + FadeInUp, + FadeOutUp, + LayoutAnimationConfig, +} from 'react-native-reanimated' +import {AppBskyGraphStarterpack} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -11,6 +16,13 @@ import {createFullHandle} from '#/lib/strings/handles' import {logger} from '#/logger' import {useServiceQuery} from '#/state/queries/service' import {useAgent} from '#/state/session' +import {parseStarterPackHttpUri} from 'lib/strings/starter-pack' +import { + useCurrentStarterPack, + useSetCurrentStarterPack, +} from 'state/preferences/starter-pack' +import {useResolveDidQuery} from 'state/queries/resolve-uri' +import {useStarterPackQuery} from 'state/queries/useStarterPackQuery' import {LoggedOutLayout} from '#/view/com/util/layouts/LoggedOutLayout' import { initialState, @@ -26,6 +38,7 @@ import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {AppLanguageDropdown} from '#/components/AppLanguageDropdown' import {Button, ButtonText} from '#/components/Button' import {Divider} from '#/components/Divider' +import {LinearGradientBackground} from '#/components/LinearGradientBackground' import {InlineLinkText} from '#/components/Link' import {Text} from '#/components/Typography' @@ -38,6 +51,15 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { const {gtMobile} = useBreakpoints() const agent = useAgent() + const currentStarterPack = useCurrentStarterPack() + const setCurrentStarterPack = useSetCurrentStarterPack() + const parsedStarterPackUri = parseStarterPackHttpUri(currentStarterPack?.uri) + const {data: did} = useResolveDidQuery(parsedStarterPackUri?.name) + const {data: starterPack} = useStarterPackQuery({ + did, + rkey: parsedStarterPackUri?.rkey, + }) + const { data: serviceInfo, isFetching, @@ -142,6 +164,50 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { description={_(msg`We're so excited to have you join us!`)} scrollable> + {starterPack && + AppBskyGraphStarterpack.isRecord(starterPack.record) ? ( + + + + {starterPack.record.name} + + + + You are signing up with a starter pack! Other users will see + that you have joined using this pack. + + + + + + ) : null} void}) { return ( - {onDismiss && screenState !== ScreenState.S_StarterPack ? ( + {onDismiss && screenState === ScreenState.S_LoginOrCreateAccount ? (