|
@ -30,16 +30,19 @@ const validationSchema = Yup.object().shape({ |
|
|
.label("pluviometer"), |
|
|
.label("pluviometer"), |
|
|
//data: Yup.string().required("Campo obrigatório. Por favor, selecione a data"),
|
|
|
//data: Yup.string().required("Campo obrigatório. Por favor, selecione a data"),
|
|
|
images: Yup.array(), |
|
|
images: Yup.array(), |
|
|
|
|
|
description: Yup.string().label("Description"), |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
function PluviometerSharingDataScreen(props) { |
|
|
function PluviometerSharingDataScreen(props) { |
|
|
const context = useContext(EventLocationContext); |
|
|
const context = useContext(EventLocationContext); |
|
|
|
|
|
|
|
|
|
|
|
const amount = 2; |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
context.defaultLocation(); |
|
|
context.defaultLocation(); |
|
|
}, []); |
|
|
}, []); |
|
|
const location = context.eventCoordinates; |
|
|
const location = context.eventCoordinates; |
|
|
const address = context.eventLocation; |
|
|
|
|
|
|
|
|
const address = context.eventLocation; |
|
|
|
|
|
|
|
|
const [dateTime, setDateTime] = useState(moment()); |
|
|
const [dateTime, setDateTime] = useState(moment()); |
|
|
const [time, setTime] = useState(moment()); |
|
|
const [time, setTime] = useState(moment()); |
|
@ -51,6 +54,7 @@ function PluviometerSharingDataScreen(props) { |
|
|
initialValues={{ |
|
|
initialValues={{ |
|
|
pluviometer: "", |
|
|
pluviometer: "", |
|
|
images: [], |
|
|
images: [], |
|
|
|
|
|
description: "", |
|
|
}} |
|
|
}} |
|
|
onSubmit={(values) => { |
|
|
onSubmit={(values) => { |
|
|
insertPluviometerData({ ...values, dateTime, time, location, address }); |
|
|
insertPluviometerData({ ...values, dateTime, time, location, address }); |
|
@ -85,7 +89,7 @@ function PluviometerSharingDataScreen(props) { |
|
|
flex: 1, |
|
|
flex: 1, |
|
|
flexDirection: "row", |
|
|
flexDirection: "row", |
|
|
justifyContent: "space-between", |
|
|
justifyContent: "space-between", |
|
|
alignContent:"flex-start", |
|
|
|
|
|
|
|
|
alignContent: "flex-start", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
{/*Data da coleta:*/} |
|
|
{/*Data da coleta:*/} |
|
@ -115,7 +119,15 @@ function PluviometerSharingDataScreen(props) { |
|
|
</TouchableOpacity> |
|
|
</TouchableOpacity> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
<View> |
|
|
|
|
|
<FormField |
|
|
|
|
|
maxLength={255} |
|
|
|
|
|
multiline |
|
|
|
|
|
name="description" |
|
|
|
|
|
numberOfLines={3} |
|
|
|
|
|
placeholder="Descrição" |
|
|
|
|
|
/> |
|
|
|
|
|
</View> |
|
|
<SubmitButton title="Enviar" style={{ marginBottom: 100 }} /> |
|
|
<SubmitButton title="Enviar" style={{ marginBottom: 100 }} /> |
|
|
<View style={{ flex: 1 }}></View> |
|
|
<View style={{ flex: 1 }}></View> |
|
|
</Form> |
|
|
</Form> |
|
@ -139,7 +151,7 @@ const styles = StyleSheet.create({ |
|
|
fontSize: dimensions.text.secondary, |
|
|
fontSize: dimensions.text.secondary, |
|
|
fontWeight: "bold", |
|
|
fontWeight: "bold", |
|
|
textAlign: "left", |
|
|
textAlign: "left", |
|
|
color: colors.primary, |
|
|
|
|
|
|
|
|
color: colors.lightBlue, |
|
|
marginBottom: 5, |
|
|
marginBottom: 5, |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|