Account creation improvements & some other fixes (#2636)

* Quick fix to mobile

* Enlarge tap targets in account creation

* Improve keyboard behaviors during account creation

* Improve autocompletion behaviors during account creation

* Use the logo in the Deactivated screen
This commit is contained in:
Paul Frazee 2024-01-25 22:24:37 -08:00 committed by GitHub
parent c8175b9c4e
commit 6149437c05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 28 additions and 18 deletions

View file

@ -14,8 +14,8 @@ import {Text} from '#/components/Typography'
import {isWeb} from '#/platform/detection' import {isWeb} from '#/platform/detection'
import {H2, P} from '#/components/Typography' import {H2, P} from '#/components/Typography'
import {ScrollView} from '#/view/com/util/Views' import {ScrollView} from '#/view/com/util/Views'
import {Group3_Stroke2_Corner0_Rounded as Group3} from '#/components/icons/Group3'
import {Loader} from '#/components/Loader' import {Loader} from '#/components/Loader'
import {Logo} from '#/view/icons/Logo'
const COL_WIDTH = 400 const COL_WIDTH = 400
@ -96,8 +96,8 @@ export function Deactivated() {
style={[a.flex_row, a.justify_center, gtMobile ? a.pt_4xl : a.px_xl]}> style={[a.flex_row, a.justify_center, gtMobile ? a.pt_4xl : a.px_xl]}>
<View style={[a.flex_1, {maxWidth: COL_WIDTH}]}> <View style={[a.flex_1, {maxWidth: COL_WIDTH}]}>
<View <View
style={[a.w_full, a.justify_center, a.align_center, a.mt_4xl]}> style={[a.w_full, a.justify_center, a.align_center, a.my_4xl]}>
<Group3 fill="none" stroke={t.palette.contrast_900} width={120} /> <Logo width={120} />
</View> </View>
<H2 style={[a.pb_sm]}> <H2 style={[a.pb_sm]}>
@ -105,8 +105,8 @@ export function Deactivated() {
</H2> </H2>
<P style={[t.atoms.text_contrast_700]}> <P style={[t.atoms.text_contrast_700]}>
<Trans> <Trans>
There's been a rush of new users! We'll activate your account as There's been a rush of new users to Bluesky! We'll activate your
soon as we can. account as soon as we can.
</Trans> </Trans>
</P> </P>

View file

@ -22,7 +22,7 @@ import {
useSetSaveFeedsMutation, useSetSaveFeedsMutation,
DEFAULT_PROD_FEEDS, DEFAULT_PROD_FEEDS,
} from '#/state/queries/preferences' } from '#/state/queries/preferences'
import {FEEDBACK_FORM_URL, IS_PROD} from '#/lib/constants' import {FEEDBACK_FORM_URL, HITSLOP_10, IS_PROD} from '#/lib/constants'
import {Step1} from './Step1' import {Step1} from './Step1'
import {Step2} from './Step2' import {Step2} from './Step2'
@ -121,7 +121,11 @@ export function CreateAccount({onPressBack}: {onPressBack: () => void}) {
leadin="" leadin=""
title={_(msg`Create Account`)} title={_(msg`Create Account`)}
description={_(msg`We're so excited to have you join us!`)}> description={_(msg`We're so excited to have you join us!`)}>
<ScrollView testID="createAccount" style={pal.view}> <ScrollView
testID="createAccount"
style={pal.view}
keyboardShouldPersistTaps="handled"
keyboardDismissMode="on-drag">
<View style={styles.stepContainer}> <View style={styles.stepContainer}>
{uiState.step === 1 && ( {uiState.step === 1 && (
<Step1 uiState={uiState} uiDispatch={uiDispatch} /> <Step1 uiState={uiState} uiDispatch={uiDispatch} />
@ -137,7 +141,8 @@ export function CreateAccount({onPressBack}: {onPressBack: () => void}) {
<TouchableOpacity <TouchableOpacity
onPress={onPressBackInner} onPress={onPressBackInner}
testID="backBtn" testID="backBtn"
accessibilityRole="button"> accessibilityRole="button"
hitSlop={HITSLOP_10}>
<Text type="xl" style={pal.link}> <Text type="xl" style={pal.link}>
<Trans>Back</Trans> <Trans>Back</Trans>
</Text> </Text>
@ -147,7 +152,8 @@ export function CreateAccount({onPressBack}: {onPressBack: () => void}) {
<TouchableOpacity <TouchableOpacity
testID="nextBtn" testID="nextBtn"
onPress={onPressNext} onPress={onPressNext}
accessibilityRole="button"> accessibilityRole="button"
hitSlop={HITSLOP_10}>
{uiState.isProcessing ? ( {uiState.isProcessing ? (
<ActivityIndicator /> <ActivityIndicator />
) : ( ) : (
@ -163,7 +169,8 @@ export function CreateAccount({onPressBack}: {onPressBack: () => void}) {
accessibilityRole="button" accessibilityRole="button"
accessibilityLabel={_(msg`Retry`)} accessibilityLabel={_(msg`Retry`)}
accessibilityHint="" accessibilityHint=""
accessibilityLiveRegion="polite"> accessibilityLiveRegion="polite"
hitSlop={HITSLOP_10}>
<Text type="xl-bold" style={[pal.link, s.pr5]}> <Text type="xl-bold" style={[pal.link, s.pr5]}>
<Trans>Retry</Trans> <Trans>Retry</Trans>
</Text> </Text>

View file

@ -144,7 +144,7 @@ export function Step1({
accessibilityHint={_(msg`Input email for Bluesky account`)} accessibilityHint={_(msg`Input email for Bluesky account`)}
accessibilityLabelledBy="email" accessibilityLabelledBy="email"
autoCapitalize="none" autoCapitalize="none"
autoComplete="off" autoComplete="email"
autoCorrect={false} autoCorrect={false}
autoFocus={!uiState.isInviteCodeRequired} autoFocus={!uiState.isInviteCodeRequired}
/> />
@ -169,7 +169,7 @@ export function Step1({
accessibilityHint={_(msg`Set password`)} accessibilityHint={_(msg`Set password`)}
accessibilityLabelledBy="password" accessibilityLabelledBy="password"
autoCapitalize="none" autoCapitalize="none"
autoComplete="off" autoComplete="new-password"
autoCorrect={false} autoCorrect={false}
/> />
</View> </View>

View file

@ -28,6 +28,7 @@ import {
FontAwesomeIcon, FontAwesomeIcon,
FontAwesomeIconStyle, FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome' } from '@fortawesome/react-native-fontawesome'
import {HITSLOP_10} from '#/lib/constants'
export function Step2({ export function Step2({
uiState, uiState,
@ -243,7 +244,8 @@ export function Step2({
<TouchableWithoutFeedback <TouchableWithoutFeedback
onPress={onPressRetry} onPress={onPressRetry}
accessibilityLabel={_(msg`Retry.`)} accessibilityLabel={_(msg`Retry.`)}
accessibilityHint=""> accessibilityHint=""
hitSlop={HITSLOP_10}>
<View style={styles.touchable}> <View style={styles.touchable}>
<Text <Text
type="md-medium" type="md-medium"

View file

@ -33,6 +33,9 @@ export function Step3({
placeholder="e.g. alice" placeholder="e.g. alice"
value={uiState.handle} value={uiState.handle}
editable editable
autoFocus
autoComplete="off"
autoCorrect={false}
onChange={value => uiDispatch({type: 'set-handle', value})} onChange={value => uiDispatch({type: 'set-handle', value})}
// TODO: Add explicit text label // TODO: Add explicit text label
accessibilityLabel={_(msg`User handle`)} accessibilityLabel={_(msg`User handle`)}

View file

@ -68,11 +68,9 @@ let PostMeta = (opts: PostMetaOpts): React.ReactNode => {
</> </>
} }
href={makeProfileLink(opts.author)} href={makeProfileLink(opts.author)}
onPointerEnter={() => { onPointerEnter={
if (isWeb) { isWeb ? () => prefetchProfileQuery(opts.author.did) : undefined
prefetchProfileQuery(opts.author.did) }
}
}}
/> />
</View> </View>
{!isAndroid && ( {!isAndroid && (