Browse Source

date-time picker added on other form screens

master
analuizaff 4 years ago
parent
commit
6c970fcdce
  1. 14
      src/app/screens/PluviometerSharingDataScreen.js
  2. 19
      src/app/screens/RainSharingDataScreen.js
  3. 20
      src/app/screens/RiverFloodSharingDataScreen.js
  4. 20
      src/app/screens/SharingFloodZonesScreen.js

14
src/app/screens/PluviometerSharingDataScreen.js

@ -82,8 +82,14 @@ function PluviometerSharingDataScreen(props) {
/> />
</View> </View>
<FormImagePicker
backgroundColor={colors.primary}
name="images"
styles={{ width: 50 }}
/>
<View style={{ marginTop: 10, flex: 1 }}> <View style={{ marginTop: 10, flex: 1 }}>
{/*<Text style={styles.labelStyle}>Data da coleta:</Text>*/}
{/*Data da coleta:*/}
<FormDatePicker <FormDatePicker
textStyle={{ textStyle={{
padding: 15, padding: 15,
@ -95,12 +101,6 @@ function PluviometerSharingDataScreen(props) {
onTimeChange={(value) => setTime(value)} onTimeChange={(value) => setTime(value)}
/> />
</View> </View>
<FormImagePicker
backgroundColor={colors.primary}
name="images"
styles={{ width: 50 }}
/>
<SubmitButton title="Enviar" style={{ marginBottom: 100 }} /> <SubmitButton title="Enviar" style={{ marginBottom: 100 }} />
<View style={{ flex: 1 }}></View> <View style={{ flex: 1 }}></View>
</Form> </Form>

19
src/app/screens/RainSharingDataScreen.js

@ -18,6 +18,8 @@ import { insertRainData } from "../database/databaseLoader";
import { showMessage } from "react-native-flash-message"; import { showMessage } from "react-native-flash-message";
import { scaleDimsFromWidth, dimensions } from "../config/dimensions"; import { scaleDimsFromWidth, dimensions } from "../config/dimensions";
import assets from "../config/assets"; import assets from "../config/assets";
import moment from "moment";
import FormDatePicker from "../components/forms/FormDatePicker";
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
images: Yup.array(), images: Yup.array(),
@ -31,6 +33,9 @@ function RainSharingDataScreen(props) {
const [error, setError] = useState(false); const [error, setError] = useState(false);
const location = useLocation(); const location = useLocation();
const [dateTime, setDateTime] = useState(moment());
const [time, setTime] = useState(moment());
return ( return (
<Screen style={styles.container}> <Screen style={styles.container}>
<Text <Text
@ -156,6 +161,20 @@ function RainSharingDataScreen(props) {
<FormImagePicker backgroundColor={colors.primary} name="images" /> <FormImagePicker backgroundColor={colors.primary} name="images" />
<View style={{ marginTop: 10, flex: 1 }}>
{/*Data da coleta:*/}
<FormDatePicker
textStyle={{
padding: 15,
borderColor: colors.gray,
borderWidth: 3,
}}
defaultDate={new Date()}
onDateChange={(value) => setDateTime(value)}
onTimeChange={(value) => setTime(value)}
/>
</View>
<FormField <FormField
maxLength={255} maxLength={255}
multiline multiline

20
src/app/screens/RiverFloodSharingDataScreen.js

@ -19,6 +19,8 @@ import { showMessage } from "react-native-flash-message";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import assets from "../config/assets"; import assets from "../config/assets";
import { scaleDimsFromWidth, dimensions } from "../config/dimensions"; import { scaleDimsFromWidth, dimensions } from "../config/dimensions";
import moment from "moment";
import FormDatePicker from "../components/forms/FormDatePicker";
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
images: Yup.array(), images: Yup.array(),
@ -32,6 +34,9 @@ function RiverFloodSharingDataScreen(props) {
const location = useLocation(); const location = useLocation();
const [error, setError] = useState(false); const [error, setError] = useState(false);
const [dateTime, setDateTime] = useState(moment());
const [time, setTime] = useState(moment());
return ( return (
<Screen style={styles.container}> <Screen style={styles.container}>
<Text <Text
@ -133,6 +138,21 @@ function RiverFloodSharingDataScreen(props) {
)} )}
<FormImagePicker backgroundColor={colors.primary} name="images" /> <FormImagePicker backgroundColor={colors.primary} name="images" />
<View style={{ marginTop: 10, flex: 1 }}>
{/*Data da coleta:*/}
<FormDatePicker
textStyle={{
padding: 15,
borderColor: colors.gray,
borderWidth: 3,
}}
defaultDate={new Date()}
onDateChange={(value) => setDateTime(value)}
onTimeChange={(value) => setTime(value)}
/>
</View>
<FormField <FormField
maxLength={255} maxLength={255}
multiline multiline

20
src/app/screens/SharingFloodZonesScreen.js

@ -13,6 +13,8 @@ import { showMessage } from "react-native-flash-message";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import Screen from "../components/Screen"; import Screen from "../components/Screen";
import assets from "../config/assets"; import assets from "../config/assets";
import moment from "moment";
import FormDatePicker from "../components/forms/FormDatePicker";
function submitForm(props) { function submitForm(props) {
console.log(props); console.log(props);
@ -29,6 +31,9 @@ function SharingFloodZonesScreen(props) {
const [error, setError] = useState(false); const [error, setError] = useState(false);
const location = useLocation(); const location = useLocation();
const [dateTime, setDateTime] = useState(moment());
const [time, setTime] = useState(moment());
return ( return (
<Screen style={styles.container}> <Screen style={styles.container}>
<Text <Text
@ -100,6 +105,21 @@ function SharingFloodZonesScreen(props) {
)} )}
<FormImagePicker name="images" height={10} /> <FormImagePicker name="images" height={10} />
<View style={{ marginTop: 10, flex: 1 }}>
{/*Data da coleta:*/}
<FormDatePicker
textStyle={{
padding: 15,
borderColor: colors.gray,
borderWidth: 3,
}}
defaultDate={new Date()}
onDateChange={(value) => setDateTime(value)}
onTimeChange={(value) => setTime(value)}
/>
</View>
<FormField <FormField
maxLength={255} maxLength={255}
multiline multiline

Loading…
Cancel
Save