@@ -20,14 +20,14 @@ import {
2020import { useUserContext } from "@/context/UserContext" ;
2121import { TR , i18n } from "@/localization/translate.service" ;
2222import { ROUTES } from "@/screens/routes" ;
23- import { MOCK_ENCOUNTER , TOURKEY } from "@/services/tourguide.service" ;
23+ import { TOURKEY } from "@/services/tourguide.service" ;
2424import { TestData } from "@/tests/src/accessors" ;
2525import { API } from "@/utils/api-config" ;
2626import { getTimePassedWithText } from "@/utils/date.utils" ;
2727import { getValidImgURI } from "@/utils/media.utils" ;
2828import { MaterialIcons } from "@expo/vector-icons" ;
2929import * as React from "react" ;
30- import { useEffect , useState } from "react" ;
30+ import { useState } from "react" ;
3131import { Image , StyleSheet , Text , View } from "react-native" ;
3232import { Dropdown } from "react-native-element-dropdown" ;
3333import { TouchableOpacity } from "react-native-gesture-handler" ;
@@ -114,73 +114,10 @@ const OEncounter = (props: ISingleEncounterProps) => {
114114 encounterProfile . otherUser . id ,
115115 ) ;
116116
117- const handleTourOnStepChange = ( e : any ) => {
118- if ( e ?. order === 2 ) {
119- dispatch ( {
120- type : EACTION_ENCOUNTERS . PUSH_MULTIPLE ,
121- payload : [ MOCK_ENCOUNTER ( { status : "met_interested" } ) ] ,
122- } ) ;
123- } else if ( e ?. order === 3 ) {
124- dispatch ( {
125- type : EACTION_ENCOUNTERS . PUSH_MULTIPLE ,
126- payload : [
127- MOCK_ENCOUNTER ( {
128- status : "met_interested" ,
129- messages : [
130- {
131- id : "44" ,
132- content :
133- "Forgot to drop my number :), +43 xxxxxxx" ,
134- senderUserId : "abc" ,
135- sentAt : new Date ( ) . toISOString ( ) ,
136- } ,
137- ] ,
138- } ) ,
139- ] ,
140- } ) ;
141- } else if ( e ?. order === 4 ) {
142- dispatch ( {
143- type : EACTION_ENCOUNTERS . PUSH_MULTIPLE ,
144- payload : [ MOCK_ENCOUNTER ( { status : "met_not_interested" } ) ] ,
145- } ) ;
146- } else if ( e ?. order === 5 ) {
147- dispatch ( {
148- type : EACTION_ENCOUNTERS . PUSH_MULTIPLE ,
149- payload : [ MOCK_ENCOUNTER ( { status : "not_met" } ) ] ,
150- } ) ;
151- } else if ( e ?. order === 6 ) {
152- // @dev revert to order4 state "previous" button would otherwise keep the 7th state.
153- dispatch ( {
154- type : EACTION_ENCOUNTERS . PUSH_MULTIPLE ,
155- payload : [ MOCK_ENCOUNTER ( { status : "not_met" } ) ] ,
156- } ) ;
157- } else if ( e ?. order === 7 ) {
158- dispatch ( {
159- type : EACTION_ENCOUNTERS . PUSH_MULTIPLE ,
160- payload : [
161- MOCK_ENCOUNTER ( {
162- status : "met_interested" ,
163- isNearbyRightNow : true ,
164- } ) ,
165- ] ,
166- } ) ;
167- }
168- } ;
169-
170- const { tourKey, eventEmitter, stop } = useTourGuideController (
117+ const { tourKey, stop : stopTour } = useTourGuideController (
171118 TOURKEY . ENCOUNTERS ,
172119 ) ;
173120
174- useEffect ( ( ) => {
175- if ( ! eventEmitter ) return ;
176- eventEmitter ?. on ( "stepChange" , handleTourOnStepChange ) ;
177-
178- return ( ) => {
179- eventEmitter ?. off ( "stepChange" , handleTourOnStepChange ) ;
180- } ;
181- // @dev Keep mapRegion in dependency to mock heatmap along current mapRegion
182- } , [ eventEmitter ] ) ;
183-
184121 return (
185122 < TourGuideZone
186123 zone = { 1 }
@@ -192,7 +129,7 @@ const OEncounter = (props: ISingleEncounterProps) => {
192129 < View style = { styles . mainContent } >
193130 < TouchableOpacity
194131 onPress = { ( ) => {
195- stop ( ) ; // @dev Stop tourguide when screen changes.
132+ stopTour ( ) ; // @dev Stop tourguide when screen changes.
196133 navigation . navigate ( ROUTES . Main . ProfileView , {
197134 user : encounterProfile . otherUser ,
198135 } ) ;
0 commit comments