diff --git a/src/components/Layout/Header/index.tsx b/src/components/Layout/Header/index.tsx index 6e4256c1e9..59c360fa18 100644 --- a/src/components/Layout/Header/index.tsx +++ b/src/components/Layout/Header/index.tsx @@ -129,6 +129,7 @@ export function BackButton({onPress, style, ...props}: Partial) { size="small" variant="ghost" color="secondary" + shape="round" onPress={onPressBack} hitSlop={HITSLOP_30} style={[ diff --git a/src/components/contacts/FindContactsFlow.tsx b/src/components/contacts/FindContactsFlow.tsx index 6cd424b6cb..461e7fbbeb 100644 --- a/src/components/contacts/FindContactsFlow.tsx +++ b/src/components/contacts/FindContactsFlow.tsx @@ -23,7 +23,7 @@ export function FindContactsFlow({ )} @@ -31,7 +31,7 @@ export function FindContactsFlow({ )} diff --git a/src/components/contacts/screens/PhoneInput.tsx b/src/components/contacts/screens/PhoneInput.tsx index 352ac2cf75..beb8814901 100644 --- a/src/components/contacts/screens/PhoneInput.tsx +++ b/src/components/contacts/screens/PhoneInput.tsx @@ -21,6 +21,7 @@ import { useGutters, useTheme, } from '#/alf' +import {OnboardingPosition} from '#/screens/Onboarding/Layout' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import * as TextField from '#/components/forms/TextField' import {InternationalPhoneCodeSelect} from '#/components/InternationalPhoneCodeSelect' @@ -40,12 +41,12 @@ import {type Action, type State, useOnPressBackButton} from '../state' export function PhoneInput({ state, dispatch, - showSkipButton, + context, onSkip, }: { state: Extract dispatch: React.ActionDispatch<[Action]> - showSkipButton: boolean + context: 'Onboarding' | 'Standalone' onSkip: () => void }) { const {_} = useLingui() @@ -131,7 +132,7 @@ export function PhoneInput({ - {showSkipButton ? ( + {context === 'Onboarding' ? ( - )} - {!gtMobile && ( ) { a.justify_center, a.z_20, a.px_xl, - {top: paddingTop.paddingTop + insets.top - 1}, - ]}> + {paddingTop: (web(paddingTop.paddingTop) ?? 0) + insets.top}, + native([t.atoms.bg, a.pb_xs, {minHeight: 48}]), + web(a.pointer_events_box_none), + ]} + onLayout={evt => setHeaderHeight(evt.nativeEvent.layout.height)}> - {state.canGoBack ? ( + + {state.canGoBack && ( + + )} + + + {IS_INTERNAL && ( - ) : ( - )} - + + + )} - - - - {Array(state.totalSteps) - .fill(0) - .map((__, i) => ( - - ))} - - - - - {children} - - - + + {children} @@ -221,22 +187,46 @@ export function Layout({children}: React.PropsWithChildren<{}>) { ) } -export function TitleText({ +function HeaderSlot({children}: {children?: React.ReactNode}) { + return ( + + {children} + + ) +} + +export function OnboardingPosition() { + const {state} = useOnboardingInternalState() + const t = useTheme() + + return ( + + + Step {state.activeStepIndex + 1} of {state.totalSteps} + + + ) +} + +export function OnboardingTitleText({ children, style, }: React.PropsWithChildren) { return ( - + {children} ) } -export function DescriptionText({ +export function OnboardingDescriptionText({ children, style, }: React.PropsWithChildren) { const t = useTheme() - return

{children}

+ return ( +

+ {children} +

+ ) } diff --git a/src/screens/Onboarding/StepFindContactsIntro/index.tsx b/src/screens/Onboarding/StepFindContactsIntro/index.tsx index ce40578b56..d4cb2c1d6f 100644 --- a/src/screens/Onboarding/StepFindContactsIntro/index.tsx +++ b/src/screens/Onboarding/StepFindContactsIntro/index.tsx @@ -4,18 +4,21 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useQuery} from '@tanstack/react-query' -import {atoms as a, useTheme} from '#/alf' +import {atoms as a} from '#/alf' import {Admonition} from '#/components/Admonition' import {Button, ButtonText} from '#/components/Button' import {ContactsHeroImage} from '#/components/contacts/components/HeroImage' import {InlineLinkText} from '#/components/Link' -import {Text} from '#/components/Typography' -import {OnboardingControls} from '../Layout' +import { + OnboardingControls, + OnboardingDescriptionText, + OnboardingPosition, + OnboardingTitleText, +} from '../Layout' import {useOnboardingInternalState} from '../state' export function StepFindContactsIntro() { const {_} = useLingui() - const t = useTheme() const {dispatch} = useOnboardingInternalState() const {data: isAvailable, isSuccess} = useQuery({ @@ -24,12 +27,13 @@ export function StepFindContactsIntro() { }) return ( - + + - + Bluesky is more fun with friends - - + + Find your friends on Bluesky by verifying your phone number and matching with your contacts. We protect your information and you @@ -41,7 +45,7 @@ export function StepFindContactsIntro() { TODO: Learn more - + {!isAvailable && isSuccess && ( @@ -57,7 +61,8 @@ export function StepFindContactsIntro() { onPress={() => dispatch({type: 'next'})} label={_(msg`Import contacts`)} size="large" - color="primary"> + color="primary" + disabled={!isAvailable}> Import contacts diff --git a/src/screens/Onboarding/StepInterests/index.tsx b/src/screens/Onboarding/StepInterests/index.tsx index ee28601e38..c859930916 100644 --- a/src/screens/Onboarding/StepInterests/index.tsx +++ b/src/screens/Onboarding/StepInterests/index.tsx @@ -8,18 +8,16 @@ import {logEvent} from '#/lib/statsig/statsig' import {capitalize} from '#/lib/strings/capitalize' import {logger} from '#/logger' import { - DescriptionText, OnboardingControls, - TitleText, + OnboardingDescriptionText, + OnboardingPosition, + OnboardingTitleText, } from '#/screens/Onboarding/Layout' import {useOnboardingInternalState} from '#/screens/Onboarding/state' import {InterestButton} from '#/screens/Onboarding/StepInterests/InterestButton' import {atoms as a} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import * as Toggle from '#/components/forms/Toggle' -import {IconCircle} from '#/components/IconCircle' -import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron' -import {Hashtag_Stroke2_Corner0_Rounded as Hashtag} from '#/components/icons/Hashtag' import {Loader} from '#/components/Loader' export function StepInterests() { @@ -53,17 +51,16 @@ export function StepInterests() { }, [selectedInterests, setSaving, dispatch]) return ( - - - - + + + What are your interests? - - + + We'll use this to help customize your experience. - + - + Continue - + {saving && } diff --git a/src/screens/Onboarding/StepProfile/index.tsx b/src/screens/Onboarding/StepProfile/index.tsx index 18ffced8a7..787711bf48 100644 --- a/src/screens/Onboarding/StepProfile/index.tsx +++ b/src/screens/Onboarding/StepProfile/index.tsx @@ -19,9 +19,10 @@ import {isCancelledError} from '#/lib/strings/errors' import {logger} from '#/logger' import {isNative, isWeb} from '#/platform/detection' import { - DescriptionText, OnboardingControls, - TitleText, + OnboardingDescriptionText, + OnboardingPosition, + OnboardingTitleText, } from '#/screens/Onboarding/Layout' import {useOnboardingInternalState} from '#/screens/Onboarding/state' import {AvatarCircle} from '#/screens/Onboarding/StepProfile/AvatarCircle' @@ -32,13 +33,10 @@ import { type PlaceholderCanvasRef, } from '#/screens/Onboarding/StepProfile/PlaceholderCanvas' import {atoms as a, useBreakpoints, useTheme} from '#/alf' -import {Button, ButtonIcon, ButtonText} from '#/components/Button' +import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import {useSheetWrapper} from '#/components/Dialog/sheet-wrapper' -import {IconCircle} from '#/components/IconCircle' -import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron' import {CircleInfo_Stroke2_Corner0_Rounded} from '#/components/icons/CircleInfo' -import {StreamingLive_Stroke2_Corner0_Rounded as StreamingLive} from '#/components/icons/StreamingLive' import {Text} from '#/components/Typography' import {type AvatarColor, avatarColors, type Emoji, emojiItems} from './types' @@ -237,19 +235,21 @@ export function StepProfile() { return ( - - - - Give your profile a face - - - - Help people know you're not a bot by uploading a picture or creating - an avatar. - - + + + + + Give your profile a face + + + + Help people know you're not a bot by uploading a picture or + creating an avatar. + + + + style={[a.w_full, a.align_center, {paddingTop: gtMobile ? 80 : 60}]}>