forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {GetContacts} from './screens/GetContacts'
2import {PhoneInput} from './screens/PhoneInput'
3import {VerifyNumber} from './screens/VerifyNumber'
4import {ViewMatches} from './screens/ViewMatches'
5import {type Action, FindContactsGoBackContext, type State} from './state'
6
7export function FindContactsFlow({
8 state,
9 dispatch,
10 onBack,
11 onCancel,
12 context = 'Standalone',
13}: {
14 state: State
15 dispatch: React.ActionDispatch<[Action]>
16 onBack?: () => void
17 onCancel: () => void
18 context: 'Onboarding' | 'Standalone'
19}) {
20 return (
21 <FindContactsGoBackContext value={onBack}>
22 {state.step === '1: phone input' && (
23 <PhoneInput
24 state={state}
25 dispatch={dispatch}
26 context={context}
27 onSkip={onCancel}
28 />
29 )}
30 {state.step === '2: verify number' && (
31 <VerifyNumber
32 state={state}
33 dispatch={dispatch}
34 context={context}
35 onSkip={onCancel}
36 />
37 )}
38 {state.step === '3: get contacts' && (
39 <GetContacts
40 state={state}
41 dispatch={dispatch}
42 onCancel={onCancel}
43 context={context}
44 />
45 )}
46 {state.step === '4: view matches' && (
47 <ViewMatches
48 state={state}
49 dispatch={dispatch}
50 context={context}
51 onNext={onCancel}
52 />
53 )}
54 </FindContactsGoBackContext>
55 )
56}