|
@ -1,14 +1,6 @@ |
|
|
import React, { useState } from "react"; |
|
|
import React, { useState } from "react"; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
StyleSheet, |
|
|
|
|
|
Text, |
|
|
|
|
|
View, |
|
|
|
|
|
Image, |
|
|
|
|
|
ScrollView, |
|
|
|
|
|
} from "react-native"; |
|
|
|
|
|
|
|
|
import { StyleSheet, Text, View, Image, ScrollView } from "react-native"; |
|
|
import * as Yup from "yup"; |
|
|
import * as Yup from "yup"; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
Form, |
|
|
Form, |
|
|
FormField, |
|
|
FormField, |
|
@ -22,6 +14,7 @@ import { insertPluviometerData } from "../database/databaseLoader"; |
|
|
import { showMessage } from "react-native-flash-message"; |
|
|
import { showMessage } from "react-native-flash-message"; |
|
|
import { scaleDimsFromWidth } from "../config/dimensions"; |
|
|
import { scaleDimsFromWidth } from "../config/dimensions"; |
|
|
import FormDatePicker from "../components/forms/FormDatePicker"; |
|
|
import FormDatePicker from "../components/forms/FormDatePicker"; |
|
|
|
|
|
import colors from "../config/colors/"; |
|
|
|
|
|
|
|
|
const dims = scaleDimsFromWidth(85, 85, 25); |
|
|
const dims = scaleDimsFromWidth(85, 85, 25); |
|
|
|
|
|
|
|
@ -35,7 +28,6 @@ const validationSchema = Yup.object().shape({ |
|
|
images: Yup.array(), |
|
|
images: Yup.array(), |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function PluviometerSharingDataScreen(props) { |
|
|
function PluviometerSharingDataScreen(props) { |
|
|
const location = useLocation(); |
|
|
const location = useLocation(); |
|
|
|
|
|
|
|
@ -48,7 +40,9 @@ function PluviometerSharingDataScreen(props) { |
|
|
style={styles.image} |
|
|
style={styles.image} |
|
|
source={require("../assets/pluviometro.png")} |
|
|
source={require("../assets/pluviometro.png")} |
|
|
/> |
|
|
/> |
|
|
<Text style={{ fontSize: 18, fontWeight: "bold", color: "#1976D2" }}> |
|
|
|
|
|
|
|
|
<Text |
|
|
|
|
|
style={{ fontSize: 18, fontWeight: "bold", color: colors.primary }} |
|
|
|
|
|
> |
|
|
Pluviômetro |
|
|
Pluviômetro |
|
|
</Text> |
|
|
</Text> |
|
|
</View> |
|
|
</View> |
|
@ -56,7 +50,6 @@ function PluviometerSharingDataScreen(props) { |
|
|
<Form |
|
|
<Form |
|
|
initialValues={{ |
|
|
initialValues={{ |
|
|
pluviometer: "", |
|
|
pluviometer: "", |
|
|
//data: "",
|
|
|
|
|
|
images: [], |
|
|
images: [], |
|
|
}} |
|
|
}} |
|
|
onSubmit={(values) => { |
|
|
onSubmit={(values) => { |
|
@ -74,7 +67,7 @@ function PluviometerSharingDataScreen(props) { |
|
|
<View style={{ marginTop: 30, flex: 1 }}> |
|
|
<View style={{ marginTop: 30, flex: 1 }}> |
|
|
<Text style={styles.labelStyle}>Quantidade de chuva:</Text> |
|
|
<Text style={styles.labelStyle}>Quantidade de chuva:</Text> |
|
|
<FormField |
|
|
<FormField |
|
|
keyboardType="number-pad" |
|
|
|
|
|
|
|
|
keyboardType="decimal-pad" |
|
|
maxLength={200} |
|
|
maxLength={200} |
|
|
name="pluviometer" |
|
|
name="pluviometer" |
|
|
placeholder="Digite a quantidade de chuva" |
|
|
placeholder="Digite a quantidade de chuva" |
|
@ -86,7 +79,7 @@ function PluviometerSharingDataScreen(props) { |
|
|
<FormDatePicker |
|
|
<FormDatePicker |
|
|
textStyle={{ |
|
|
textStyle={{ |
|
|
padding: 15, |
|
|
padding: 15, |
|
|
borderColor: "gray", |
|
|
|
|
|
|
|
|
borderColor: colors.gray, |
|
|
borderWidth: 3, |
|
|
borderWidth: 3, |
|
|
}} |
|
|
}} |
|
|
defaultDate={new Date()} |
|
|
defaultDate={new Date()} |
|
@ -95,7 +88,7 @@ function PluviometerSharingDataScreen(props) { |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
<FormImagePicker |
|
|
<FormImagePicker |
|
|
backgroundColor="#1976D2" |
|
|
|
|
|
|
|
|
backgroundColor={colors.primary} |
|
|
name="images" |
|
|
name="images" |
|
|
styles={{ width: 50 }} |
|
|
styles={{ width: 50 }} |
|
|
/> |
|
|
/> |
|
@ -107,8 +100,6 @@ function PluviometerSharingDataScreen(props) { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({ |
|
|
const styles = StyleSheet.create({ |
|
|
container: { |
|
|
container: { |
|
|
padding: 10, |
|
|
padding: 10, |
|
@ -124,7 +115,7 @@ const styles = StyleSheet.create({ |
|
|
fontSize: 16, |
|
|
fontSize: 16, |
|
|
fontWeight: "bold", |
|
|
fontWeight: "bold", |
|
|
textAlign: "left", |
|
|
textAlign: "left", |
|
|
color: "#1976D2", |
|
|
|
|
|
|
|
|
color: colors.primary, |
|
|
marginBottom: 5, |
|
|
marginBottom: 5, |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|