Browse Source

tryind to solve a navigation issue

master
analuizaff 3 years ago
parent
commit
a722e82b62
  1. 9
      src/app/navigation/AppNavigator.js
  2. 3
      src/app/navigation/SharingDataOptionsNavigator.js
  3. 4
      src/app/screens/RainSharingDataScreen.js

9
src/app/navigation/AppNavigator.js

@ -8,8 +8,6 @@ import MessagesNavigator from "./MessagesNavigator";
import ForecastNavigator from "./ForecastNavigator";
import NewListingButton from "./NewListingButton";
import SharingDataOptionsNavigator from "./SharingDataOptionsNavigator";
import SharingDataNavigator from "./SharingDataNavigator";
import routes from "./routes";
const Tab = createBottomTabNavigator();
@ -45,7 +43,12 @@ const AppNavigator = () => (
tabBarButton: () => (
<NewListingButton
onPress={() =>
navigation.navigate(routes.SHARING_DATA)}
navigation.reset({
index: 0,
key: "RainSharingData",
routes: [{ name: "SharingData" }],
})
}
/>
),
tabBarIcon: ({ color, size }) => (

3
src/app/navigation/SharingDataOptionsNavigator.js

@ -9,6 +9,7 @@ import SharingFloodZonesScreen from '../screens/SharingFloodZonesScreen';
import PluviometerSharingDataScreen from '../screens/PluviometerSharingDataScreen';
import SharingDataNavigator from './SharingDataNavigator';
import MapFormScreen from '../screens/MapFormScreen';
import { CommonActions } from '@react-navigation/native';
const Stack = createStackNavigator();
@ -62,7 +63,7 @@ function SharingDataOptionsNavigator() {
backgroundColor: "white",
},
}}
/>
/>
<Stack.Screen
name="FormMap"
component={MapFormScreen}

4
src/app/screens/RainSharingDataScreen.js

@ -42,10 +42,10 @@ function RainSharingDataScreen(props) {
}, []);
console.log(props.route)
useEffect(() => {
/*useEffect(() => {
!isFocused &&
props.navigation.goBack();
}, [isFocused])
}, [isFocused])*/
const location = context.eventCoordinates;
const address = context.eventLocation;

Loading…
Cancel
Save