Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 69 lines 2.2 kB view raw
1import {useState} from 'react' 2import {LayoutAnimationConfig} from 'react-native-reanimated' 3import {msg} from '@lingui/core/macro' 4import {useLingui} from '@lingui/react' 5import {usePreventRemove} from '@react-navigation/native' 6 7import { 8 type AllNavigatorParams, 9 type NativeStackScreenProps, 10} from '#/lib/routes/types' 11import {useEnableMinimalShellMode} from '#/state/shell' 12import {ErrorScreen} from '#/view/com/util/error/ErrorScreen' 13import {FindContactsFlow} from '#/components/contacts/FindContactsFlow' 14import {useFindContactsFlowState} from '#/components/contacts/state' 15import * as Layout from '#/components/Layout' 16import {ScreenTransition} from '#/components/ScreenTransition' 17import {IS_NATIVE} from '#/env' 18 19type Props = NativeStackScreenProps<AllNavigatorParams, 'FindContactsFlow'> 20export function FindContactsFlowScreen({navigation}: Props) { 21 const {_} = useLingui() 22 23 const [state, dispatch] = useFindContactsFlowState() 24 25 const [transitionDirection, setTransitionDirection] = useState< 26 'Forward' | 'Backward' 27 >('Forward') 28 29 const overrideGoBack = state.step === '2: verify number' 30 31 usePreventRemove(overrideGoBack, () => { 32 setTransitionDirection('Backward') 33 dispatch({type: 'BACK'}) 34 setTimeout(() => { 35 setTransitionDirection('Forward') 36 }) 37 }) 38 39 useEnableMinimalShellMode() 40 41 return ( 42 <Layout.Screen> 43 {IS_NATIVE ? ( 44 <LayoutAnimationConfig skipEntering skipExiting> 45 <ScreenTransition key={state.step} direction={transitionDirection}> 46 <FindContactsFlow 47 state={state} 48 dispatch={dispatch} 49 onCancel={() => 50 navigation.canGoBack() 51 ? navigation.goBack() 52 : navigation.navigate('FindContactsFlow', undefined, { 53 pop: true, 54 }) 55 } 56 context="Standalone" 57 /> 58 </ScreenTransition> 59 </LayoutAnimationConfig> 60 ) : ( 61 <ErrorScreen 62 title={_(msg`Not available on this platform.`)} 63 message={_(msg`Please use the native app to sync your contacts.`)} 64 showHeader 65 /> 66 )} 67 </Layout.Screen> 68 ) 69}