@@ -12,15 +12,15 @@ const EndOzModal = ({ navigation }) => {
12
12
const [ currentPage , setCurrentPage ] = useState ( 0 ) ;
13
13
const pagerRef = useRef ( null ) ;
14
14
15
- const onStartPress = async ( ) => {
16
- storage . set ( "@OnboardingDoneWithCGU" , true ) ;
17
- navigation . navigate ( "USER_SURVEY_START" , { from : "NEW_USER" } ) ;
18
- } ;
19
-
20
15
const onPressNext = ( ) => {
21
16
if ( pagerRef . current ) {
22
- pagerRef . current . setPage ( currentPage + 1 ) ;
23
- setCurrentPage ( currentPage + 1 ) ;
17
+ if ( currentPage === 3 ) {
18
+ navigation . goBack ( ) ;
19
+ } else {
20
+ pagerRef . current . setPage ( currentPage + 1 ) ;
21
+
22
+ setCurrentPage ( currentPage + 1 ) ;
23
+ }
24
24
} else {
25
25
console . warn ( "Pager ref is not defined" ) ;
26
26
}
@@ -40,7 +40,12 @@ const EndOzModal = ({ navigation }) => {
40
40
< SafeAreaView className = "flex-1 justify-center items-center" >
41
41
< View className = "bg-white rounded-xl w-[90%] h-[70%]" >
42
42
< View className = "h-5 flex flex-row justify-end p-3" >
43
- < TouchableOpacity hitSlop = { hitSlop ( 15 ) } onPress = { ( ) => { } } >
43
+ < TouchableOpacity
44
+ hitSlop = { hitSlop ( 15 ) }
45
+ onPress = { ( ) => {
46
+ navigation . goBack ( ) ;
47
+ } }
48
+ >
44
49
< Svg fill = "none" viewBox = "0 0 24 24" className = "h-5 w-5" >
45
50
< Path
46
51
strokeLinecap = "round"
@@ -79,7 +84,9 @@ const EndOzModal = ({ navigation }) => {
79
84
onPress = { onPressNext }
80
85
className = "justify-center items-center flex-row rounded-3xl bg-[#DE285E] px-6 py-3"
81
86
>
82
- < Text className = "font-bold text-white text-center text-base" > Suivant</ Text >
87
+ < Text className = "font-bold text-white text-center text-base" >
88
+ { currentPage === 3 ? "Terminer" : "Suivant" }
89
+ </ Text >
83
90
</ TouchableOpacity >
84
91
</ View >
85
92
</ View >
0 commit comments