|
@ -3,24 +3,17 @@ import { StyleSheet, Text, View, ScrollView, PixelRatio, SafeAreaView, KeyboardA |
|
|
import * as Yup from "yup"; |
|
|
import * as Yup from "yup"; |
|
|
import { |
|
|
import { |
|
|
Form, |
|
|
Form, |
|
|
FormField, |
|
|
|
|
|
FormPicker as Picker, |
|
|
|
|
|
SubmitButton, |
|
|
SubmitButton, |
|
|
} from "../components/forms"; |
|
|
} from "../components/forms"; |
|
|
import Screen from "../components/Screen"; |
|
|
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 { showMessage } from "react-native-flash-message"; |
|
|
import { dimensions, scaleDimsFromWidth } from "../config/dimensions"; |
|
|
import { dimensions, scaleDimsFromWidth } from "../config/dimensions"; |
|
|
import FormDatePicker from "../components/forms/FormDatePicker"; |
|
|
import FormDatePicker from "../components/forms/FormDatePicker"; |
|
|
import colors from "../config/colors/"; |
|
|
import colors from "../config/colors/"; |
|
|
import moment from "moment"; |
|
|
import moment from "moment"; |
|
|
import FormLocationPicker from "../components/forms/FormLocationPicker"; |
|
|
import FormLocationPicker from "../components/forms/FormLocationPicker"; |
|
|
import { TextInput, TouchableOpacity } from "react-native-gesture-handler"; |
|
|
|
|
|
import { EventLocationContext } from "../context/EventLocationContext"; |
|
|
import { EventLocationContext } from "../context/EventLocationContext"; |
|
|
import SchoolPicker from "../components/SchoolPicker"; |
|
|
import SchoolPicker from "../components/SchoolPicker"; |
|
|
import { KeyboardAwareFlatList, KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -59,29 +52,33 @@ function PluviometerRegisterScreen(props) { |
|
|
<View |
|
|
<View |
|
|
style={{ |
|
|
style={{ |
|
|
flexDirection: "column", |
|
|
flexDirection: "column", |
|
|
justifyContent: "space-between", |
|
|
|
|
|
alignContent: "flex-start", |
|
|
alignContent: "flex-start", |
|
|
flex: 0.9, |
|
|
|
|
|
|
|
|
justifyContent: "space-evenly", |
|
|
|
|
|
flex: 1 |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<View style={{ flex: 0.8 }}> |
|
|
|
|
|
|
|
|
<View style={{ flex: 0.10 }}> |
|
|
<Text style={styles.title}>Cadastro do Pluviômetro</Text> |
|
|
<Text style={styles.title}>Cadastro do Pluviômetro</Text> |
|
|
</View> |
|
|
</View> |
|
|
<View style={{ flex: 2 }}> |
|
|
|
|
|
|
|
|
<View style={{ flex: 0.30 }}> |
|
|
<Text style={styles.label}>Escola: </Text> |
|
|
<Text style={styles.label}>Escola: </Text> |
|
|
<SchoolPicker |
|
|
<SchoolPicker |
|
|
itemSelected={(value) => setSchool(value)} /> |
|
|
itemSelected={(value) => setSchool(value)} /> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
<View style={{ |
|
|
|
|
|
flex: 0.60, flexDirection: "column", |
|
|
|
|
|
justifyContent: "space-between" |
|
|
|
|
|
}}> |
|
|
|
|
|
<ScrollView> |
|
|
|
|
|
|
|
|
<View style={{ flex: 2 }}> |
|
|
|
|
|
{/*Local do evento:*/} |
|
|
{/*Local do evento:*/} |
|
|
|
|
|
<View style={{ flex: 1 }}> |
|
|
<Text style={styles.label}>Endereço do pluviômetro: </Text> |
|
|
<Text style={styles.label}>Endereço do pluviômetro: </Text> |
|
|
<ScrollView> |
|
|
|
|
|
<FormLocationPicker subtitle="Defina o endereço do pluviômetro" /> |
|
|
<FormLocationPicker subtitle="Defina o endereço do pluviômetro" /> |
|
|
</ScrollView> |
|
|
|
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
{/*Data da coleta:*/} |
|
|
{/*Data da coleta:*/} |
|
|
<View style={{ flex: 2 }}> |
|
|
|
|
|
|
|
|
<View style={{ flex: 1 }}> |
|
|
<Text style={{ |
|
|
<Text style={{ |
|
|
fontSize: dimensions.text.secondary, |
|
|
fontSize: dimensions.text.secondary, |
|
|
fontWeight: "bold", |
|
|
fontWeight: "bold", |
|
@ -100,8 +97,13 @@ function PluviometerRegisterScreen(props) { |
|
|
onTimeChange={(value) => setTime(value)} |
|
|
onTimeChange={(value) => setTime(value)} |
|
|
/> |
|
|
/> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
<View style={{ flex: 0.10, marginTop:15 }}> |
|
|
|
|
|
<SubmitButton title="Cadastrar" alignContent="flex-end" /> |
|
|
|
|
|
</View> |
|
|
|
|
|
</ScrollView> |
|
|
|
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
<SubmitButton title="Cadastrar" style={{ marginBottom: 100 }} /> |
|
|
|
|
|
</Form> |
|
|
</Form> |
|
|
</Screen> |
|
|
</Screen> |
|
|
); |
|
|
); |
|
|