|
@ -1,4 +1,4 @@ |
|
|
import React, { useState } from "react"; |
|
|
|
|
|
|
|
|
import React, { useContext, useEffect, useState } from "react"; |
|
|
import { StyleSheet, View, ScrollView } from "react-native"; |
|
|
import { StyleSheet, View, ScrollView } from "react-native"; |
|
|
import * as Yup from "yup"; |
|
|
import * as Yup from "yup"; |
|
|
|
|
|
|
|
@ -21,6 +21,8 @@ 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 { CurrentLocationContext } from "../context/CurrentLocationContext"; |
|
|
|
|
|
import { EventLocationContext } from "../context/EventLocationContext"; |
|
|
|
|
|
|
|
|
const validationSchema = Yup.object().shape({ |
|
|
const validationSchema = Yup.object().shape({ |
|
|
images: Yup.array(), |
|
|
images: Yup.array(), |
|
@ -32,12 +34,21 @@ const borderWidth = 4; |
|
|
function RainSharingDataScreen(props) { |
|
|
function RainSharingDataScreen(props) { |
|
|
const [rain, setRain] = useState(-1); |
|
|
const [rain, setRain] = useState(-1); |
|
|
const [error, setError] = useState(false); |
|
|
const [error, setError] = useState(false); |
|
|
const location = useLocation(); |
|
|
|
|
|
|
|
|
const location = "useLocation()"; |
|
|
|
|
|
|
|
|
|
|
|
const dims = scaleDimsFromWidth(85, 85, 27); |
|
|
|
|
|
|
|
|
const [date, setDate] = useState(moment()); |
|
|
const [date, setDate] = useState(moment()); |
|
|
const [time, setTime] = useState(moment()); |
|
|
const [time, setTime] = useState(moment()); |
|
|
|
|
|
|
|
|
const dims = scaleDimsFromWidth(85, 85, 27); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//======== testei aqui pra ver se atualiza a localização pro default quando abre o formulário ===========
|
|
|
|
|
|
|
|
|
|
|
|
const context = useContext(EventLocationContext); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
context.defaultLocation(); |
|
|
|
|
|
}, []); |
|
|
|
|
|
//========================================================================================================
|
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Screen style={styles.container}> |
|
|
<Screen style={styles.container}> |
|
|