|
|
@ -3,24 +3,17 @@ import { StyleSheet, Text, View, ScrollView, PixelRatio, SafeAreaView, KeyboardA |
|
|
|
import * as Yup from "yup"; |
|
|
|
import { |
|
|
|
Form, |
|
|
|
FormField, |
|
|
|
FormPicker as Picker, |
|
|
|
SubmitButton, |
|
|
|
} from "../components/forms"; |
|
|
|
import Screen from "../components/Screen"; |
|
|
|
import useLocation from "../hooks/useLocation"; |
|
|
|
import FormImagePicker from "../components/forms/FormImagePicker"; |
|
|
|
import { insertPluviometerData } from "../database/databaseLoader"; |
|
|
|
import { showMessage } from "react-native-flash-message"; |
|
|
|
import { dimensions, scaleDimsFromWidth } from "../config/dimensions"; |
|
|
|
import FormDatePicker from "../components/forms/FormDatePicker"; |
|
|
|
import colors from "../config/colors/"; |
|
|
|
import moment from "moment"; |
|
|
|
import FormLocationPicker from "../components/forms/FormLocationPicker"; |
|
|
|
import { TextInput, TouchableOpacity } from "react-native-gesture-handler"; |
|
|
|
import { EventLocationContext } from "../context/EventLocationContext"; |
|
|
|
import SchoolPicker from "../components/SchoolPicker"; |
|
|
|
import { KeyboardAwareFlatList, KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -41,67 +34,76 @@ function PluviometerRegisterScreen(props) { |
|
|
|
return ( |
|
|
|
<Screen style={styles.container}> |
|
|
|
<Form |
|
|
|
initialValues={{ |
|
|
|
initialValues={{ |
|
|
|
|
|
|
|
}} |
|
|
|
onSubmit={() => { |
|
|
|
//insertRainData({ ...values, rain, location, date, time, address });
|
|
|
|
showMessage({ |
|
|
|
message: "Ainda não implementado", |
|
|
|
duration: 1950, |
|
|
|
icon: "warning", |
|
|
|
type: "warning", |
|
|
|
onPress: () => { }, |
|
|
|
}); |
|
|
|
//props.navigation.navigate("Home");
|
|
|
|
}}> |
|
|
|
}} |
|
|
|
onSubmit={() => { |
|
|
|
//insertRainData({ ...values, rain, location, date, time, address });
|
|
|
|
showMessage({ |
|
|
|
message: "Ainda não implementado", |
|
|
|
duration: 1950, |
|
|
|
icon: "warning", |
|
|
|
type: "warning", |
|
|
|
onPress: () => { }, |
|
|
|
}); |
|
|
|
//props.navigation.navigate("Home");
|
|
|
|
}}> |
|
|
|
|
|
|
|
<View |
|
|
|
style={{ |
|
|
|
flexDirection: "column", |
|
|
|
justifyContent: "space-between", |
|
|
|
alignContent: "flex-start", |
|
|
|
flex: 0.9, |
|
|
|
justifyContent: "space-evenly", |
|
|
|
flex: 1 |
|
|
|
}} |
|
|
|
> |
|
|
|
<View style={{ flex: 0.8 }}> |
|
|
|
<Text style={styles.title}> Cadastro do Pluviômetro </Text> |
|
|
|
<View style={{ flex: 0.10 }}> |
|
|
|
<Text style={styles.title}>Cadastro do Pluviômetro</Text> |
|
|
|
</View> |
|
|
|
<View style={{ flex: 2 }}> |
|
|
|
<View style={{ flex: 0.30 }}> |
|
|
|
<Text style={styles.label}>Escola: </Text> |
|
|
|
<SchoolPicker |
|
|
|
itemSelected={(value) => setSchool(value)} /> |
|
|
|
</View> |
|
|
|
|
|
|
|
<View style={{ flex: 2 }}> |
|
|
|
{/*Local do evento:*/} |
|
|
|
<Text style={styles.label}>Endereço do pluviômetro: </Text> |
|
|
|
<View style={{ |
|
|
|
flex: 0.60, flexDirection: "column", |
|
|
|
justifyContent: "space-between" |
|
|
|
}}> |
|
|
|
<ScrollView> |
|
|
|
<FormLocationPicker subtitle="Defina o endereço do pluviômetro" /> |
|
|
|
|
|
|
|
{/*Local do evento:*/} |
|
|
|
<View style={{ flex: 1 }}> |
|
|
|
<Text style={styles.label}>Endereço do pluviômetro: </Text> |
|
|
|
<FormLocationPicker subtitle="Defina o endereço do pluviômetro" /> |
|
|
|
</View> |
|
|
|
|
|
|
|
{/*Data da coleta:*/} |
|
|
|
<View style={{ flex: 1 }}> |
|
|
|
<Text style={{ |
|
|
|
fontSize: dimensions.text.secondary, |
|
|
|
fontWeight: "bold", |
|
|
|
textAlign: "left", |
|
|
|
color: colors.lightBlue, marginBottom: 10 |
|
|
|
}}>Data do cadastro: </Text> |
|
|
|
<FormDatePicker |
|
|
|
disabled={true} |
|
|
|
textStyle={{ |
|
|
|
borderColor: colors.gray, |
|
|
|
borderWidth: 3, |
|
|
|
}} |
|
|
|
subtitle=" " |
|
|
|
defaultDate={new Date()} |
|
|
|
onDateChange={(value) => setDateTime(value)} |
|
|
|
onTimeChange={(value) => setTime(value)} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
|
|
|
|
<View style={{ flex: 0.10, marginTop:15 }}> |
|
|
|
<SubmitButton title="Cadastrar" alignContent="flex-end" /> |
|
|
|
</View> |
|
|
|
</ScrollView> |
|
|
|
</View> |
|
|
|
{/*Data da coleta:*/} |
|
|
|
<View style={{ flex: 2 }}> |
|
|
|
<Text style={{ |
|
|
|
fontSize: dimensions.text.secondary, |
|
|
|
fontWeight: "bold", |
|
|
|
textAlign: "left", |
|
|
|
color: colors.lightBlue, marginBottom: 10 |
|
|
|
}}>Data do cadastro: </Text> |
|
|
|
<FormDatePicker |
|
|
|
disabled={true} |
|
|
|
textStyle={{ |
|
|
|
borderColor: colors.gray, |
|
|
|
borderWidth: 3, |
|
|
|
}} |
|
|
|
subtitle=" " |
|
|
|
defaultDate={new Date()} |
|
|
|
onDateChange={(value) => setDateTime(value)} |
|
|
|
onTimeChange={(value) => setTime(value)} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<SubmitButton title="Cadastrar" style={{ marginBottom: 100 }} /> |
|
|
|
</Form> |
|
|
|
</Screen> |
|
|
|
); |
|
|
|