1- import { NativeStackNavigationProp } from '@react-navigation/native-stack' ;
21import React , {
32 memo ,
43 ReactElement ,
@@ -8,17 +7,12 @@ import React, {
87} from 'react' ;
98import { Trans , useTranslation } from 'react-i18next' ;
109import { Image , ImageSourcePropType , StyleSheet , View } from 'react-native' ;
11- import { useAppDispatch , useAppSelector } from '../../hooks/redux' ;
1210
13- import DetectSwipe from '../../components/DetectSwipe' ;
1411import NavigationHeader from '../../components/NavigationHeader' ;
1512import SafeAreaInset from '../../components/SafeAreaInset' ;
1613import SwitchRow from '../../components/SwitchRow' ;
1714import Button from '../../components/buttons/Button' ;
18- import type {
19- RootStackParamList ,
20- RootStackScreenProps ,
21- } from '../../navigation/types' ;
15+ import { useAppDispatch , useAppSelector } from '../../hooks/redux' ;
2216import {
2317 selectedNetworkSelector ,
2418 selectedWalletSelector ,
@@ -33,35 +27,30 @@ import { updateSlashPayConfig } from '../../utils/slashtags';
3327const crownImageSrc = require ( '../../assets/illustrations/crown.png' ) ;
3428const coinsImageSrc = require ( '../../assets/illustrations/coin-stack.png' ) ;
3529
36- export const ProfileIntro = memo (
37- ( { navigation } : RootStackScreenProps < 'Profile' > ) : ReactElement => {
38- const { t } = useTranslation ( 'slashtags' ) ;
30+ export const ProfileIntro = memo ( ( ) : ReactElement => {
31+ const { t } = useTranslation ( 'slashtags' ) ;
3932
40- return (
41- < Layout
42- navigation = { navigation }
43- illustration = { crownImageSrc }
44- nextStep = "InitialEdit"
45- buttonText = { t ( 'continue' ) }
46- header = { t ( 'profile' ) } >
47- < Display >
48- < Trans
49- t = { t }
50- i18nKey = "onboarding_profile1_header"
51- components = { { accent : < Display color = "brand" /> } }
52- />
53- </ Display >
54- < BodyM color = "secondary" style = { styles . introText } >
55- { t ( 'onboarding_profile1_text' ) }
56- </ BodyM >
57- </ Layout >
58- ) ;
59- } ,
60- ) ;
33+ return (
34+ < Layout
35+ illustration = { crownImageSrc }
36+ nextStep = "InitialEdit"
37+ buttonText = { t ( 'continue' ) }
38+ header = { t ( 'profile' ) } >
39+ < Display >
40+ < Trans
41+ t = { t }
42+ i18nKey = "onboarding_profile1_header"
43+ components = { { accent : < Display color = "brand" /> } }
44+ />
45+ </ Display >
46+ < BodyM color = "secondary" style = { styles . introText } >
47+ { t ( 'onboarding_profile1_text' ) }
48+ </ BodyM >
49+ </ Layout >
50+ ) ;
51+ } ) ;
6152
62- export const OfflinePayments = ( {
63- navigation,
64- } : RootStackScreenProps < 'Profile' > ) : ReactElement => {
53+ export const OfflinePayments = ( ) : ReactElement => {
6554 const { t } = useTranslation ( 'slashtags' ) ;
6655 const dispatch = useAppDispatch ( ) ;
6756 const selectedWallet = useAppSelector ( selectedWalletSelector ) ;
@@ -75,7 +64,6 @@ export const OfflinePayments = ({
7564
7665 return (
7766 < Layout
78- navigation = { navigation }
7967 illustration = { coinsImageSrc }
8068 nextStep = "Done"
8169 buttonText = { t ( 'continue' ) }
@@ -106,15 +94,13 @@ export const OfflinePayments = ({
10694
10795const Layout = memo (
10896 ( {
109- navigation,
11097 illustration,
11198 nextStep,
11299 buttonText,
113100 header,
114101 children,
115102 onNext,
116103 } : {
117- navigation : NativeStackNavigationProp < RootStackParamList , 'Profile' > ;
118104 illustration : ImageSourcePropType ;
119105 nextStep : TSlashtagsState [ 'onboardingProfileStep' ] ;
120106 buttonText : string ;
@@ -124,34 +110,28 @@ const Layout = memo(
124110 } ) : ReactElement => {
125111 const dispatch = useAppDispatch ( ) ;
126112
127- const onSwipeLeft = ( ) : void => {
128- navigation . popToTop ( ) ;
129- } ;
130-
131113 return (
132114 < ThemedView style = { styles . root } >
133115 < SafeAreaInset type = "top" />
134116 < NavigationHeader title = { header } />
135- < DetectSwipe onSwipeLeft = { onSwipeLeft } >
136- < View style = { styles . content } >
137- < View style = { styles . imageContainer } >
138- < Image style = { styles . image } source = { illustration } />
139- </ View >
140- < View style = { styles . middleContainer } > { children } </ View >
141- < View style = { styles . buttonContainer } >
142- < Button
143- style = { styles . button }
144- text = { buttonText }
145- size = "large"
146- testID = "OnboardingContinue"
147- onPress = { ( ) : void => {
148- onNext ?.( ) ;
149- dispatch ( setOnboardingProfileStep ( nextStep ) ) ;
150- } }
151- />
152- </ View >
117+ < View style = { styles . content } >
118+ < View style = { styles . imageContainer } >
119+ < Image style = { styles . image } source = { illustration } />
120+ </ View >
121+ < View style = { styles . middleContainer } > { children } </ View >
122+ < View style = { styles . buttonContainer } >
123+ < Button
124+ style = { styles . button }
125+ text = { buttonText }
126+ size = "large"
127+ testID = "OnboardingContinue"
128+ onPress = { ( ) : void => {
129+ onNext ?.( ) ;
130+ dispatch ( setOnboardingProfileStep ( nextStep ) ) ;
131+ } }
132+ />
153133 </ View >
154- </ DetectSwipe >
134+ </ View >
155135 < SafeAreaInset type = "bottom" minPadding = { 16 } />
156136 </ ThemedView >
157137 ) ;
0 commit comments