Automatically resolve hosting provider from handle (#11053)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -10,7 +10,7 @@ import {logger} from '#/logger'
|
||||
import {useSignupContext} from '#/screens/Signup/state'
|
||||
import {CaptchaWebView} from '#/screens/Signup/StepCaptcha/CaptchaWebView'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {FormError} from '#/components/forms/FormError'
|
||||
import {Admonition} from '#/components/Admonition'
|
||||
import {useAnalytics} from '#/analytics'
|
||||
import {GCP_PROJECT_ID, IS_ANDROID, IS_IOS, IS_NATIVE, IS_WEB} from '#/env'
|
||||
import {BackNextButtons} from '../BackNextButtons'
|
||||
@@ -168,7 +168,7 @@ function StepCaptchaInner({
|
||||
<ActivityIndicator size="large" />
|
||||
)}
|
||||
</View>
|
||||
<FormError error={state.error} />
|
||||
{state.error && <Admonition type="error">{state.error}</Admonition>}
|
||||
</View>
|
||||
<BackNextButtons
|
||||
hideNext
|
||||
|
||||
@@ -14,7 +14,6 @@ import * as Dialog from '#/components/Dialog'
|
||||
import {DeviceLocationRequestDialog} from '#/components/dialogs/DeviceLocationRequestDialog'
|
||||
import * as DateField from '#/components/forms/DateField'
|
||||
import {type DateFieldRef} from '#/components/forms/DateField/types'
|
||||
import {FormError} from '#/components/forms/FormError'
|
||||
import {HostingProvider} from '#/components/forms/HostingProvider'
|
||||
import * as TextField from '#/components/forms/TextField'
|
||||
import {Envelope_Stroke2_Corner0_Rounded as Envelope} from '#/components/icons/Envelope'
|
||||
@@ -172,7 +171,11 @@ export function StepInfo({
|
||||
return (
|
||||
<>
|
||||
<View style={[a.gap_md, a.pt_lg]}>
|
||||
<FormError error={state.error} />
|
||||
{state.error && (
|
||||
<Admonition.Admonition type="error">
|
||||
{state.error}
|
||||
</Admonition.Admonition>
|
||||
)}
|
||||
<HostingProvider
|
||||
minimal
|
||||
serviceUrl={state.serviceUrl}
|
||||
|
||||
+115
-104
@@ -1,6 +1,7 @@
|
||||
import {useEffect, useReducer, useState} from 'react'
|
||||
import {AppState, type AppStateStatus, View} from 'react-native'
|
||||
import ReactNativeDeviceAttest from 'react-native-device-attest'
|
||||
import {KeyboardAvoidingView} from 'react-native-keyboard-controller'
|
||||
import Animated, {FadeIn, LayoutAnimationConfig} from 'react-native-reanimated'
|
||||
import {AppBskyGraphStarterpack} from '@atproto/api'
|
||||
import {tokens} from '@bsky.app/alf'
|
||||
@@ -131,125 +132,135 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
||||
return (
|
||||
<Animated.View exiting={native(FadeIn.duration(90))} style={a.flex_1}>
|
||||
<SignupContext.Provider value={{state, dispatch}}>
|
||||
<LoggedOutLayout
|
||||
leadin=""
|
||||
title={l`Create account`}
|
||||
description={l`We’re so excited to have you join us!`}
|
||||
scrollable>
|
||||
<View testID="createAccount" style={a.flex_1}>
|
||||
{showStarterPackCard &&
|
||||
bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||
starterPack.record,
|
||||
AppBskyGraphStarterpack.isRecord,
|
||||
) ? (
|
||||
<Animated.View entering={!isFetchedAtMount ? FadeIn : undefined}>
|
||||
<LinearGradientBackground
|
||||
style={[a.mx_lg, a.p_lg, a.gap_sm, a.rounded_sm]}>
|
||||
<Text style={[a.font_semi_bold, a.text_xl, {color: 'white'}]}>
|
||||
{starterPack.record.name}
|
||||
</Text>
|
||||
<Text style={[{color: 'white'}]}>
|
||||
{starterPack.feeds?.length ? (
|
||||
<Trans>
|
||||
You'll follow the suggested users and feeds once you
|
||||
finish creating your account!
|
||||
</Trans>
|
||||
) : (
|
||||
<Trans>
|
||||
You'll follow the suggested users once you finish
|
||||
creating your account!
|
||||
</Trans>
|
||||
)}
|
||||
</Text>
|
||||
</LinearGradientBackground>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
<LayoutAnimationConfig skipEntering>
|
||||
<ScreenTransition
|
||||
key={state.activeStep}
|
||||
direction={state.screenTransitionDirection}>
|
||||
<View
|
||||
style={[
|
||||
a.flex_1,
|
||||
a.px_xl,
|
||||
a.pt_2xl,
|
||||
!gtMobile && {paddingBottom: 100},
|
||||
]}>
|
||||
<View style={[a.gap_sm, a.pb_3xl]}>
|
||||
<KeyboardAvoidingView
|
||||
behavior="padding"
|
||||
style={a.flex_1}
|
||||
automaticOffset>
|
||||
<LoggedOutLayout
|
||||
leadin=""
|
||||
title={l`Create account`}
|
||||
description={l`We’re so excited to have you join us!`}
|
||||
scrollable>
|
||||
<View testID="createAccount" style={a.flex_1}>
|
||||
{showStarterPackCard &&
|
||||
bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
||||
starterPack.record,
|
||||
AppBskyGraphStarterpack.isRecord,
|
||||
) ? (
|
||||
<Animated.View
|
||||
entering={!isFetchedAtMount ? FadeIn : undefined}>
|
||||
<LinearGradientBackground
|
||||
style={[a.mx_lg, a.p_lg, a.gap_sm, a.rounded_sm]}>
|
||||
<Text
|
||||
style={[a.font_semi_bold, t.atoms.text_contrast_medium]}>
|
||||
<Trans>
|
||||
Step {state.activeStep + 1} of{' '}
|
||||
{state.serviceDescription &&
|
||||
!state.serviceDescription.phoneVerificationRequired
|
||||
? '2'
|
||||
: '3'}
|
||||
</Trans>
|
||||
style={[a.font_semi_bold, a.text_xl, {color: 'white'}]}>
|
||||
{starterPack.record.name}
|
||||
</Text>
|
||||
<Text style={[a.text_3xl, a.font_semi_bold]}>
|
||||
{state.activeStep === SignupStep.INFO ? (
|
||||
<Trans>Your account</Trans>
|
||||
) : state.activeStep === SignupStep.HANDLE ? (
|
||||
<Trans>Choose your username</Trans>
|
||||
<Text style={[{color: 'white'}]}>
|
||||
{starterPack.feeds?.length ? (
|
||||
<Trans>
|
||||
You'll follow the suggested users and feeds once you
|
||||
finish creating your account!
|
||||
</Trans>
|
||||
) : (
|
||||
<Trans>Complete the challenge</Trans>
|
||||
<Trans>
|
||||
You'll follow the suggested users once you finish
|
||||
creating your account!
|
||||
</Trans>
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
{state.activeStep === SignupStep.INFO ? (
|
||||
<StepInfo
|
||||
onPressBack={onPressBack}
|
||||
isLoadingStarterPack={
|
||||
isFetchingStarterPack && !isErrorStarterPack
|
||||
}
|
||||
isServerError={isError}
|
||||
refetchServer={() => void refetch()}
|
||||
/>
|
||||
) : state.activeStep === SignupStep.HANDLE ? (
|
||||
<StepHandle />
|
||||
) : (
|
||||
<StepCaptcha />
|
||||
)}
|
||||
|
||||
<Divider />
|
||||
|
||||
</LinearGradientBackground>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
<LayoutAnimationConfig skipEntering>
|
||||
<ScreenTransition
|
||||
key={state.activeStep}
|
||||
direction={state.screenTransitionDirection}>
|
||||
<View
|
||||
style={[
|
||||
a.w_full,
|
||||
a.py_lg,
|
||||
a.flex_row,
|
||||
a.gap_md,
|
||||
a.align_center,
|
||||
a.flex_1,
|
||||
a.px_xl,
|
||||
a.pt_2xl,
|
||||
!gtMobile && {paddingBottom: 100},
|
||||
]}>
|
||||
<AppLanguageDropdown />
|
||||
<View
|
||||
style={
|
||||
gtMobile
|
||||
? [a.flex_1, a.flex, a.flex_row, a.justify_end]
|
||||
: []
|
||||
}>
|
||||
<View style={[a.gap_sm, a.pb_3xl]}>
|
||||
<Text
|
||||
style={[
|
||||
a.font_semi_bold,
|
||||
t.atoms.text_contrast_medium,
|
||||
!gtMobile && a.text_md,
|
||||
{paddingInline: tokens.space.sm},
|
||||
]}>
|
||||
<Trans>Having trouble?</Trans>{' '}
|
||||
<InlineLinkText
|
||||
label={l`Contact support`}
|
||||
to={FEEDBACK_FORM_URL({email: state.email})}
|
||||
style={[!gtMobile && a.text_md]}>
|
||||
<Trans>Contact support</Trans>
|
||||
</InlineLinkText>
|
||||
<Trans>
|
||||
Step {state.activeStep + 1} of{' '}
|
||||
{state.serviceDescription &&
|
||||
!state.serviceDescription.phoneVerificationRequired
|
||||
? '2'
|
||||
: '3'}
|
||||
</Trans>
|
||||
</Text>
|
||||
<Text style={[a.text_3xl, a.font_semi_bold]}>
|
||||
{state.activeStep === SignupStep.INFO ? (
|
||||
<Trans>Your account</Trans>
|
||||
) : state.activeStep === SignupStep.HANDLE ? (
|
||||
<Trans>Choose your username</Trans>
|
||||
) : (
|
||||
<Trans>Complete the challenge</Trans>
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
{state.activeStep === SignupStep.INFO ? (
|
||||
<StepInfo
|
||||
onPressBack={onPressBack}
|
||||
isLoadingStarterPack={
|
||||
isFetchingStarterPack && !isErrorStarterPack
|
||||
}
|
||||
isServerError={isError}
|
||||
refetchServer={() => void refetch()}
|
||||
/>
|
||||
) : state.activeStep === SignupStep.HANDLE ? (
|
||||
<StepHandle />
|
||||
) : (
|
||||
<StepCaptcha />
|
||||
)}
|
||||
|
||||
<Divider />
|
||||
|
||||
<View
|
||||
style={[
|
||||
a.w_full,
|
||||
a.py_lg,
|
||||
a.flex_row,
|
||||
a.gap_md,
|
||||
a.align_center,
|
||||
]}>
|
||||
<AppLanguageDropdown />
|
||||
<View
|
||||
style={
|
||||
gtMobile
|
||||
? [a.flex_1, a.flex, a.flex_row, a.justify_end]
|
||||
: []
|
||||
}>
|
||||
<Text
|
||||
style={[
|
||||
t.atoms.text_contrast_medium,
|
||||
!gtMobile && a.text_md,
|
||||
{paddingInline: tokens.space.sm},
|
||||
]}>
|
||||
<Trans>Having trouble?</Trans>{' '}
|
||||
<InlineLinkText
|
||||
label={l`Contact support`}
|
||||
to={FEEDBACK_FORM_URL({email: state.email})}
|
||||
style={[!gtMobile && a.text_md]}>
|
||||
<Trans>Contact support</Trans>
|
||||
</InlineLinkText>
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</ScreenTransition>
|
||||
</LayoutAnimationConfig>
|
||||
</View>
|
||||
</LoggedOutLayout>
|
||||
</ScreenTransition>
|
||||
</LayoutAnimationConfig>
|
||||
</View>
|
||||
</LoggedOutLayout>
|
||||
</KeyboardAvoidingView>
|
||||
</SignupContext.Provider>
|
||||
</Animated.View>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user