Browse Source

Another attempt to solve a navigation problem to 'SharingDataScreen'

master
analuizaff 3 years ago
parent
commit
59d38721df
  1. 9
      src/app/navigation/AppNavigator.js
  2. 1
      src/app/screens/PluviometerSharingDataScreen.js
  3. 6
      src/app/screens/RainSharingDataScreen.js
  4. 1
      src/app/screens/RiverFloodSharingDataScreen.js
  5. 1
      src/app/screens/SharingFloodZonesScreen.js

9
src/app/navigation/AppNavigator.js

@ -40,13 +40,12 @@ const AppNavigator = () => (
name="SharingData" name="SharingData"
component={SharingDataOptionsNavigator} component={SharingDataOptionsNavigator}
options={({ navigation }) => ({ options={({ navigation }) => ({
tabBarButton: () => (
tabBarButton: () => (
<NewListingButton <NewListingButton
onPress={() => onPress={() =>
navigation.reset({
index: 0,
key: "RainSharingData",
routes: [{ name: "SharingData" }],
navigation.navigate("SharingData",{
screen:"Voltar",
initial: false,
}) })
} }
/> />

1
src/app/screens/PluviometerSharingDataScreen.js

@ -64,7 +64,6 @@ function PluviometerSharingDataScreen(props) {
icon: "success", icon: "success",
type: "success", type: "success",
}); });
props.navigation.goBack();
props.navigation.navigate("Home"); props.navigation.navigate("Home");
}} }}
validationSchema={validationSchema} validationSchema={validationSchema}

6
src/app/screens/RainSharingDataScreen.js

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

1
src/app/screens/RiverFloodSharingDataScreen.js

@ -72,7 +72,6 @@ function RiverFloodSharingDataScreen(props) {
icon: "success", icon: "success",
type: "success", type: "success",
}); });
props.navigation.goBack();
props.navigation.navigate("Home"); props.navigation.navigate("Home");
}} }}
validationSchema={validationSchema} validationSchema={validationSchema}

1
src/app/screens/SharingFloodZonesScreen.js

@ -68,7 +68,6 @@ function SharingFloodZonesScreen(props) {
icon: "success", icon: "success",
type: "success", type: "success",
}); });
props.navigation.goBack();
props.navigation.navigate("Home"); props.navigation.navigate("Home");
}} }}
validationSchema={validationSchema} validationSchema={validationSchema}

Loading…
Cancel
Save