From bbdfe05ada30c13252f933005d043a486ccbdca8 Mon Sep 17 00:00:00 2001 From: DS Boyce <260543580+ds-boyce@users.noreply.github.com> Date: Tue, 7 Jul 2026 05:37:49 -0700 Subject: [PATCH] Use Sift for username suggestions during signup (#11051) --- eslint-suppressions.json | 5 - .../index.native.tsx} | 32 +++---- .../StepHandle/HandleSuggestions/index.tsx | 94 +++++++++++++++++++ .../StepHandle/HandleSuggestions/shared.ts | 15 +++ src/screens/Signup/StepHandle/index.tsx | 32 ++++++- 5 files changed, 152 insertions(+), 26 deletions(-) rename src/screens/Signup/StepHandle/{HandleSuggestions.tsx => HandleSuggestions/index.native.tsx} (74%) create mode 100644 src/screens/Signup/StepHandle/HandleSuggestions/index.tsx create mode 100644 src/screens/Signup/StepHandle/HandleSuggestions/shared.ts diff --git a/eslint-suppressions.json b/eslint-suppressions.json index 3cdac1d101..2e323dd73e 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -1430,11 +1430,6 @@ "count": 1 } }, - "src/screens/Signup/StepHandle/index.tsx": { - "@typescript-eslint/no-misused-promises": { - "count": 1 - } - }, "src/screens/Signup/StepInfo/Policies.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 diff --git a/src/screens/Signup/StepHandle/HandleSuggestions.tsx b/src/screens/Signup/StepHandle/HandleSuggestions/index.native.tsx similarity index 74% rename from src/screens/Signup/StepHandle/HandleSuggestions.tsx rename to src/screens/Signup/StepHandle/HandleSuggestions/index.native.tsx index 0b7c0fb93e..1dfb15e955 100644 --- a/src/screens/Signup/StepHandle/HandleSuggestions.tsx +++ b/src/screens/Signup/StepHandle/HandleSuggestions/index.native.tsx @@ -1,25 +1,23 @@ import Animated, {Easing, FadeInDown, FadeOut} from 'react-native-reanimated' -import {type ComAtprotoTempCheckHandleAvailability} from '@atproto/api' -import {msg} from '@lingui/core/macro' -import {useLingui} from '@lingui/react' -import {Trans} from '@lingui/react/macro' +import {Trans, useLingui} from '@lingui/react/macro' import {atoms as a, native, useTheme} from '#/alf' import {borderRadius} from '#/alf/tokens' import {Button} from '#/components/Button' import {Text} from '#/components/Typography' +import {type HandleSuggestionsProps} from './shared' +/** + * Native: suggestions render inline beneath the availability error, animating + * in with the surrounding requirement stack. See index.tsx for the web variant, + * which floats them in a Sift dropdown anchored to the input. + */ export function HandleSuggestions({ suggestions, onSelect, -}: { - suggestions: ComAtprotoTempCheckHandleAvailability.Suggestion[] - onSelect: ( - suggestions: ComAtprotoTempCheckHandleAvailability.Suggestion, - ) => void -}) { +}: HandleSuggestionsProps) { const t = useTheme() - const {_} = useLingui() + const {t: l} = useLingui() return ( {suggestions.map((suggestion, index) => (