Browse Source

date-time picker added on other form screens

master
analuizaff 4 years ago
parent
commit
6c970fcdce
  1. 16
      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

16
src/app/screens/PluviometerSharingDataScreen.js

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

19
src/app/screens/RainSharingDataScreen.js

@ -18,6 +18,8 @@ import { insertRainData } from "../database/databaseLoader";
import { showMessage } from "react-native-flash-message";
import { scaleDimsFromWidth, dimensions } from "../config/dimensions";
import assets from "../config/assets";
import moment from "moment";
import FormDatePicker from "../components/forms/FormDatePicker";
const validationSchema = Yup.object().shape({
images: Yup.array(),
@ -31,6 +33,9 @@ function RainSharingDataScreen(props) {
const [error, setError] = useState(false);
const location = useLocation();
const [dateTime, setDateTime] = useState(moment());
const [time, setTime] = useState(moment());
return (
<Screen style={styles.container}>
<Text
@ -156,6 +161,20 @@ function RainSharingDataScreen(props) {
<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
maxLength={255}
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 assets from "../config/assets";
import { scaleDimsFromWidth, dimensions } from "../config/dimensions";
import moment from "moment";
import FormDatePicker from "../components/forms/FormDatePicker";
const validationSchema = Yup.object().shape({
images: Yup.array(),
@ -32,6 +34,9 @@ function RiverFloodSharingDataScreen(props) {
const location = useLocation();
const [error, setError] = useState(false);
const [dateTime, setDateTime] = useState(moment());
const [time, setTime] = useState(moment());
return (
<Screen style={styles.container}>
<Text
@ -133,6 +138,21 @@ function RiverFloodSharingDataScreen(props) {
)}
<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
maxLength={255}
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 Screen from "../components/Screen";
import assets from "../config/assets";
import moment from "moment";
import FormDatePicker from "../components/forms/FormDatePicker";
function submitForm(props) {
console.log(props);
@ -29,6 +31,9 @@ function SharingFloodZonesScreen(props) {
const [error, setError] = useState(false);
const location = useLocation();
const [dateTime, setDateTime] = useState(moment());
const [time, setTime] = useState(moment());
return (
<Screen style={styles.container}>
<Text
@ -100,6 +105,21 @@ function SharingFloodZonesScreen(props) {
)}
<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
maxLength={255}
multiline

Loading…
Cancel
Save