Browse Source

tryind to solve a navigation issue

master
analuizaff 3 years ago
parent
commit
a722e82b62
  1. 9
      src/app/navigation/AppNavigator.js
  2. 1
      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 ForecastNavigator from "./ForecastNavigator";
import NewListingButton from "./NewListingButton"; import NewListingButton from "./NewListingButton";
import SharingDataOptionsNavigator from "./SharingDataOptionsNavigator"; import SharingDataOptionsNavigator from "./SharingDataOptionsNavigator";
import SharingDataNavigator from "./SharingDataNavigator";
import routes from "./routes";
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
@ -45,7 +43,12 @@ const AppNavigator = () => (
tabBarButton: () => ( tabBarButton: () => (
<NewListingButton <NewListingButton
onPress={() => onPress={() =>
navigation.navigate(routes.SHARING_DATA)}
navigation.reset({
index: 0,
key: "RainSharingData",
routes: [{ name: "SharingData" }],
})
}
/> />
), ),
tabBarIcon: ({ color, size }) => ( tabBarIcon: ({ color, size }) => (

1
src/app/navigation/SharingDataOptionsNavigator.js

@ -9,6 +9,7 @@ import SharingFloodZonesScreen from '../screens/SharingFloodZonesScreen';
import PluviometerSharingDataScreen from '../screens/PluviometerSharingDataScreen'; import PluviometerSharingDataScreen from '../screens/PluviometerSharingDataScreen';
import SharingDataNavigator from './SharingDataNavigator'; import SharingDataNavigator from './SharingDataNavigator';
import MapFormScreen from '../screens/MapFormScreen'; import MapFormScreen from '../screens/MapFormScreen';
import { CommonActions } from '@react-navigation/native';
const Stack = createStackNavigator(); const Stack = createStackNavigator();

4
src/app/screens/RainSharingDataScreen.js

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

Loading…
Cancel
Save