|
@ -1,4 +1,4 @@ |
|
|
import React, { useState } from "react"; |
|
|
|
|
|
|
|
|
import React, { useState, useContext, useEffect } from "react"; |
|
|
import { StyleSheet, Text, Image, View } from "react-native"; |
|
|
import { StyleSheet, Text, Image, View } from "react-native"; |
|
|
import * as Yup from "yup"; |
|
|
import * as Yup from "yup"; |
|
|
|
|
|
|
|
@ -19,6 +19,7 @@ import assets from "../config/assets"; |
|
|
import moment from "moment"; |
|
|
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"; |
|
|
|
|
|
|
|
|
function submitForm(props) { |
|
|
function submitForm(props) { |
|
|
console.log(props); |
|
|
console.log(props); |
|
@ -33,11 +34,16 @@ const validationSchema = Yup.object().shape({ |
|
|
function SharingFloodZonesScreen(props) { |
|
|
function SharingFloodZonesScreen(props) { |
|
|
const [passable, setPassable] = useState(-1); |
|
|
const [passable, setPassable] = useState(-1); |
|
|
const [error, setError] = useState(false); |
|
|
const [error, setError] = useState(false); |
|
|
const location = "useLocation()"; |
|
|
|
|
|
|
|
|
|
|
|
const [date, setDate] = useState(moment()); |
|
|
const [date, setDate] = useState(moment()); |
|
|
const [time, setTime] = useState(moment()); |
|
|
const [time, setTime] = useState(moment()); |
|
|
|
|
|
|
|
|
|
|
|
const context = useContext(EventLocationContext); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
context.defaultLocation(); |
|
|
|
|
|
}, []); |
|
|
|
|
|
const location = context.eventCoordinates; |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Screen style={styles.container}> |
|
|
<Screen style={styles.container}> |
|
|
<KeyboardAwareScrollView |
|
|
<KeyboardAwareScrollView |
|
|