|
@ -16,6 +16,7 @@ import moment from "moment"; |
|
|
import FormDatePicker from "../components/forms/FormDatePicker"; |
|
|
import FormDatePicker from "../components/forms/FormDatePicker"; |
|
|
import FormLocationPicker from "../components/forms/FormLocationPicker"; |
|
|
import FormLocationPicker from "../components/forms/FormLocationPicker"; |
|
|
import { EventLocationContext } from "../context/EventLocationContext"; |
|
|
import { EventLocationContext } from "../context/EventLocationContext"; |
|
|
|
|
|
import {useIsFocused} from "@react-navigation/native"; |
|
|
|
|
|
|
|
|
const validationSchema = Yup.object().shape({ |
|
|
const validationSchema = Yup.object().shape({ |
|
|
images: Yup.array(), |
|
|
images: Yup.array(), |
|
@ -25,6 +26,7 @@ const validationSchema = Yup.object().shape({ |
|
|
const borderWidth = 4; |
|
|
const borderWidth = 4; |
|
|
|
|
|
|
|
|
function RainSharingDataScreen(props) { |
|
|
function RainSharingDataScreen(props) { |
|
|
|
|
|
const isFocused = useIsFocused(); |
|
|
const [rain, setRain] = useState(-1); |
|
|
const [rain, setRain] = useState(-1); |
|
|
const [error, setError] = useState(false); |
|
|
const [error, setError] = useState(false); |
|
|
|
|
|
|
|
@ -39,6 +41,12 @@ 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; |
|
|
|
|
|
|
|
@ -62,7 +70,6 @@ function RainSharingDataScreen(props) { |
|
|
type: "success", |
|
|
type: "success", |
|
|
onPress: () => { }, |
|
|
onPress: () => { }, |
|
|
}); |
|
|
}); |
|
|
props.navigation.goBack(); |
|
|
|
|
|
props.navigation.navigate("Home"); |
|
|
props.navigation.navigate("Home"); |
|
|
}} |
|
|
}} |
|
|
validationSchema={validationSchema} |
|
|
validationSchema={validationSchema} |
|
|