|
@ -19,6 +19,9 @@ import { FontAwesome5 } from '@expo/vector-icons'; |
|
|
import { showMessage } from "react-native-flash-message"; |
|
|
import { showMessage } from "react-native-flash-message"; |
|
|
import moment from 'moment'; |
|
|
import moment from 'moment'; |
|
|
import colors from "../config/colors"; |
|
|
import colors from "../config/colors"; |
|
|
|
|
|
import { scaleDimsFromWidth } from "../config/dimensions"; |
|
|
|
|
|
|
|
|
|
|
|
const dims = scaleDimsFromWidth(85, 85, 25); |
|
|
|
|
|
|
|
|
const validationSchema = Yup.object().shape({ |
|
|
const validationSchema = Yup.object().shape({ |
|
|
pluviometer: Yup.number().required("Campo obrigatório").min(0, "O valor deve ser maior ou igual a 0.").max(10000).label("pluviometer"), |
|
|
pluviometer: Yup.number().required("Campo obrigatório").min(0, "O valor deve ser maior ou igual a 0.").max(10000).label("pluviometer"), |
|
@ -74,7 +77,7 @@ function PluviometerSharingDataScreen(props) { |
|
|
return ( |
|
|
return ( |
|
|
<Screen style={styles.container}> |
|
|
<Screen style={styles.container}> |
|
|
|
|
|
|
|
|
<View style={{ alignSelf: "center" }}> |
|
|
|
|
|
|
|
|
<View style={{ alignItems: "center" }}> |
|
|
<Image |
|
|
<Image |
|
|
style={styles.image} |
|
|
style={styles.image} |
|
|
source={require("../assets/pluviometro.png")} |
|
|
source={require("../assets/pluviometro.png")} |
|
@ -87,7 +90,7 @@ function PluviometerSharingDataScreen(props) { |
|
|
<Form |
|
|
<Form |
|
|
initialValues={{ |
|
|
initialValues={{ |
|
|
pluviometer: "", |
|
|
pluviometer: "", |
|
|
data:"", |
|
|
|
|
|
|
|
|
data: "", |
|
|
images: [], |
|
|
images: [], |
|
|
}} |
|
|
}} |
|
|
onSubmit={(values) => { |
|
|
onSubmit={(values) => { |
|
@ -105,30 +108,33 @@ function PluviometerSharingDataScreen(props) { |
|
|
<View style={{ marginTop: 30, flex: 1 }}> |
|
|
<View style={{ marginTop: 30, flex: 1 }}> |
|
|
<Text style={styles.labelStyle}> |
|
|
<Text style={styles.labelStyle}> |
|
|
Quantidade de chuva: |
|
|
Quantidade de chuva: |
|
|
</Text> |
|
|
|
|
|
<FormField |
|
|
|
|
|
keyboardType="number-pad" |
|
|
|
|
|
maxLength={200} |
|
|
|
|
|
name="pluviometer" |
|
|
|
|
|
placeholder="Digite a quantidade de chuva" |
|
|
|
|
|
flex= {1} |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
</Text> |
|
|
|
|
|
<View style={{ flex: 1, flexDirection: 'row' }}> |
|
|
|
|
|
<FormField |
|
|
|
|
|
keyboardType="number-pad" |
|
|
|
|
|
maxLength={200} |
|
|
|
|
|
name="pluviometer" |
|
|
|
|
|
placeholder="Digite a quantidade de chuva" |
|
|
|
|
|
/> |
|
|
|
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
<View style={{ marginTop: 10, width: 220, borderRadius: 25 }}> |
|
|
|
|
|
|
|
|
<View style={{ marginTop: 10, flex: 1, borderRadius: 25 }}> |
|
|
<Text style={styles.labelStyle}> |
|
|
<Text style={styles.labelStyle}> |
|
|
Data da coleta: |
|
|
Data da coleta: |
|
|
</Text> |
|
|
</Text> |
|
|
<View style={{flexDirection:"row"}}> |
|
|
|
|
|
<FormField |
|
|
|
|
|
keyboardType="numbers-and-punctuation" |
|
|
|
|
|
maxLength={10} |
|
|
|
|
|
name="data" |
|
|
|
|
|
placeholder="dd/mm/aaaa" |
|
|
|
|
|
width={240} |
|
|
|
|
|
values={dateTime} |
|
|
|
|
|
/> |
|
|
|
|
|
<FontAwesome5 style={styles.dateIcon} name="calendar-day" size={24} color="grey" /> |
|
|
|
|
|
|
|
|
<View style={{ flex: 1, flexDirection: 'row' }}> |
|
|
|
|
|
<View style={{ flex: 1 }}> |
|
|
|
|
|
<FormField |
|
|
|
|
|
keyboardType="numbers-and-punctuation" |
|
|
|
|
|
maxLength={10} |
|
|
|
|
|
name="data" |
|
|
|
|
|
placeholder="dd/mm/aaaa" |
|
|
|
|
|
values={dateTime} |
|
|
|
|
|
flex={1} |
|
|
|
|
|
/> |
|
|
|
|
|
</View> |
|
|
|
|
|
<FontAwesome5 style={styles.dateIcon} name="calendar-day" size={24} color="grey" /> |
|
|
</View> |
|
|
</View> |
|
|
{/* |
|
|
{/* |
|
|
<TouchableOpacity style={styles.datepickerStyle} |
|
|
<TouchableOpacity style={styles.datepickerStyle} |
|
@ -195,7 +201,7 @@ function PluviometerSharingDataScreen(props) { |
|
|
</View> |
|
|
</View> |
|
|
</TouchableOpacity> |
|
|
</TouchableOpacity> |
|
|
*/} |
|
|
*/} |
|
|
</View> |
|
|
|
|
|
|
|
|
</View> |
|
|
<FormImagePicker |
|
|
<FormImagePicker |
|
|
backgroundColor="#1976D2" |
|
|
backgroundColor="#1976D2" |
|
|
name="images" |
|
|
name="images" |
|
@ -214,11 +220,11 @@ const styles = StyleSheet.create({ |
|
|
container: { |
|
|
container: { |
|
|
padding: 10, |
|
|
padding: 10, |
|
|
flex: 1 |
|
|
flex: 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
image: { |
|
|
image: { |
|
|
width: 85, |
|
|
|
|
|
height: 85, |
|
|
|
|
|
|
|
|
width: dims.width * 0.8, |
|
|
|
|
|
height: dims.height * 0.8, |
|
|
justifyContent: "center", |
|
|
justifyContent: "center", |
|
|
alignItems: "center", |
|
|
alignItems: "center", |
|
|
}, |
|
|
}, |
|
|