|
@ -13,6 +13,7 @@ import { EventLocationContext } from "../context/EventLocationContext"; |
|
|
import SchoolPicker from "../components/SchoolPicker"; |
|
|
import SchoolPicker from "../components/SchoolPicker"; |
|
|
import { TouchableOpacity } from "react-native-gesture-handler"; |
|
|
import { TouchableOpacity } from "react-native-gesture-handler"; |
|
|
import DatePicker from "../components/DatePicker"; |
|
|
import DatePicker from "../components/DatePicker"; |
|
|
|
|
|
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; |
|
|
|
|
|
|
|
|
const dims = scaleDimsFromWidth(85, 85, 25); |
|
|
const dims = scaleDimsFromWidth(85, 85, 25); |
|
|
|
|
|
|
|
@ -30,7 +31,11 @@ function PluviometerRegisterScreen(props) { |
|
|
const [school, setSchool] = useState(); |
|
|
const [school, setSchool] = useState(); |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<View style={styles.container}> |
|
|
|
|
|
|
|
|
<View |
|
|
|
|
|
style={{ |
|
|
|
|
|
padding: 16, |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
<Form |
|
|
<Form |
|
|
initialValues={{}} |
|
|
initialValues={{}} |
|
|
onSubmit={() => { |
|
|
onSubmit={() => { |
|
@ -43,9 +48,12 @@ function PluviometerRegisterScreen(props) { |
|
|
}); |
|
|
}); |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
|
|
|
{/* <KeyboardAwareScrollView */} |
|
|
|
|
|
{/* keyboardShouldPersistTaps={"handled"} */} |
|
|
|
|
|
{/* > */} |
|
|
<View |
|
|
<View |
|
|
style={{ |
|
|
style={{ |
|
|
alignContent: "flex-start", |
|
|
|
|
|
|
|
|
height: "100%", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<Text style={styles.title}>Cadastro do Pluviômetro</Text> |
|
|
<Text style={styles.title}>Cadastro do Pluviômetro</Text> |
|
@ -54,38 +62,47 @@ function PluviometerRegisterScreen(props) { |
|
|
<Text |
|
|
<Text |
|
|
style={{ |
|
|
style={{ |
|
|
marginTop: 24, |
|
|
marginTop: 24, |
|
|
|
|
|
marginBottom: 12, |
|
|
fontSize: dimensions.text.secondary, |
|
|
fontSize: dimensions.text.secondary, |
|
|
fontWeight: "bold", |
|
|
fontWeight: "bold", |
|
|
textAlign: "left", |
|
|
textAlign: "left", |
|
|
color: colors.primary, |
|
|
|
|
|
|
|
|
color: colors.secondary, |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
Data do cadastro:{" "} |
|
|
Data do cadastro:{" "} |
|
|
</Text> |
|
|
</Text> |
|
|
|
|
|
|
|
|
|
|
|
<View |
|
|
|
|
|
style={{ |
|
|
|
|
|
marginBottom: 24 |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
<FormDatePicker |
|
|
<FormDatePicker |
|
|
onDateChange={(value) => setDate(value)} |
|
|
onDateChange={(value) => setDate(value)} |
|
|
onTimeChange={(value) => setTime(value)} |
|
|
onTimeChange={(value) => setTime(value)} |
|
|
date={date} |
|
|
date={date} |
|
|
time={time} |
|
|
time={time} |
|
|
|
|
|
formTypeFace={"pluviometerRegister"} |
|
|
/> |
|
|
/> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
{/* <View style={{ marginTop: 5 }}> */} |
|
|
|
|
|
{/* <Text style={styles.label}>Escola: </Text> */} |
|
|
|
|
|
{/* <SchoolPicker itemSelected={(value) => setSchool(value)} /> */} |
|
|
|
|
|
{/* </View> */} |
|
|
|
|
|
|
|
|
<TouchableOpacity |
|
|
|
|
|
onPress={() => props.navigation.navigate("FormMap")} |
|
|
|
|
|
> |
|
|
|
|
|
<View> |
|
|
|
|
|
<Text style={styles.label}>Endereço do pluviômetro*: </Text> |
|
|
|
|
|
<FormLocationPicker subtitle="Defina o endereço do pluviômetro" /> |
|
|
|
|
|
</View> |
|
|
|
|
|
</TouchableOpacity> |
|
|
|
|
|
|
|
|
{/* <TouchableOpacity */} |
|
|
|
|
|
{/* onPress={() => props.navigation.navigate("FormMap")} */} |
|
|
|
|
|
{/* > */} |
|
|
|
|
|
{/* <View> */} |
|
|
|
|
|
{/* <Text style={styles.label}>Endereço do pluviômetro: </Text> */} |
|
|
|
|
|
{/* <FormLocationPicker subtitle="Defina o endereço do pluviômetro" /> */} |
|
|
|
|
|
{/* </View> */} |
|
|
|
|
|
{/* </TouchableOpacity> */} |
|
|
|
|
|
|
|
|
<View style={{ marginTop: 24, marginBottom: 12 }}> |
|
|
|
|
|
<Text style={styles.label}>Instituição: </Text> |
|
|
|
|
|
<SchoolPicker itemSelected={(value) => setSchool(value)} /> |
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
<SubmitButton title="Cadastrar" alignContent="flex-end" /> |
|
|
|
|
|
|
|
|
<SubmitButton title="Cadastrar" paddingHorizontal={0} /> |
|
|
|
|
|
</View> |
|
|
|
|
|
{/* </KeyboardAwareScrollView> */} |
|
|
</View> |
|
|
</View> |
|
|
</Form> |
|
|
</Form> |
|
|
</View> |
|
|
</View> |
|
@ -93,9 +110,6 @@ function PluviometerRegisterScreen(props) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({ |
|
|
const styles = StyleSheet.create({ |
|
|
container: { |
|
|
|
|
|
padding: 10, |
|
|
|
|
|
}, |
|
|
|
|
|
image: { |
|
|
image: { |
|
|
width: dims.width * 0.8, |
|
|
width: dims.width * 0.8, |
|
|
height: dims.height * 0.8, |
|
|
height: dims.height * 0.8, |
|
@ -104,12 +118,13 @@ const styles = StyleSheet.create({ |
|
|
}, |
|
|
}, |
|
|
label: { |
|
|
label: { |
|
|
fontSize: dimensions.text.secondary, |
|
|
fontSize: dimensions.text.secondary, |
|
|
|
|
|
marginBottom: 12, |
|
|
fontWeight: "bold", |
|
|
fontWeight: "bold", |
|
|
textAlign: "left", |
|
|
textAlign: "left", |
|
|
color: colors.lightBlue, |
|
|
|
|
|
|
|
|
color: colors.secondary, |
|
|
}, |
|
|
}, |
|
|
title: { |
|
|
title: { |
|
|
fontSize: 16, |
|
|
|
|
|
|
|
|
fontSize: 18, |
|
|
fontWeight: "bold", |
|
|
fontWeight: "bold", |
|
|
textAlign: "center", |
|
|
textAlign: "center", |
|
|
color: colors.primary, |
|
|
color: colors.primary, |
|
|