diff --git a/src/app/components/ImageInput.js b/src/app/components/ImageInput.js
index 776c438..a0ee4c5 100644
--- a/src/app/components/ImageInput.js
+++ b/src/app/components/ImageInput.js
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from "react";
+import { Shadow } from "react-native-shadow-2";
import {
View,
StyleSheet,
@@ -70,12 +71,24 @@ const launchImageLibrary = async (onChangeImage, callBack) => {
function addNewImageBtn() {
return (
-
-
-
- CÂMERA
-
-
+
+
+
+
+
+
+ CÂMERA
+
+
+
+
);
}
@@ -227,15 +240,20 @@ const styles = StyleSheet.create({
fontWeight: "bold",
height: 35,
},
+ addBtnContainer: {
+ padding: 16,
+ elevation: 40,
+ marginVertical: 24,
+ width: "100%",
+ },
addBtn: {
- marginVertical: 10,
- borderRadius: 6,
- flexDirection: "row",
- alignItems: "center",
justifyContent: "center",
- backgroundColor: colors.primary,
+ flexDirection: "row",
height: 42,
width: "100%",
+ alignItems: "center",
+ borderRadius: 6,
+ backgroundColor: colors.primary,
},
});
diff --git a/src/app/components/PickEventDateLocation.js b/src/app/components/PickEventDateLocation.js
new file mode 100644
index 0000000..f528167
--- /dev/null
+++ b/src/app/components/PickEventDateLocation.js
@@ -0,0 +1,44 @@
+import React from "react";
+import { View } from "react-native";
+
+import colors from "../config/colors";
+import { TouchableOpacity } from "react-native-gesture-handler";
+import FormDatePicker from "../components/forms/FormDatePicker";
+import FormLocationPicker from "../components/forms/FormLocationPicker";
+
+export default function PickEventDateLocation({
+ setDate = () => {},
+ setTime = () => {},
+ navigation = () => {},
+ location = true,
+}) {
+ return (
+
+ {/*Data da coleta:*/}
+
+ setDate(value)}
+ onTimeChange={(value) => setTime(value)}
+ />
+
+ {/*Local do evento:*/}
+ {location &&
+ navigation.navigate("FormMap")}>
+
+ }
+
+ );
+}
diff --git a/src/app/components/TextInput.js b/src/app/components/TextInput.js
index b2c6673..2e00ebf 100644
--- a/src/app/components/TextInput.js
+++ b/src/app/components/TextInput.js
@@ -3,9 +3,18 @@ import { View, TextInput, StyleSheet } from "react-native";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import colors from "../config/colors";
import defaultStyles from "../config/styles";
+import {Shadow} from "react-native-shadow-2";
function AppTextInput({ icon, width = "100%", ...otherProps }) {
return (
+
{icon && (
+
);
}
@@ -32,7 +42,6 @@ const styles = StyleSheet.create({
borderWidth: 1,
padding: 10,
flexDirection: "row",
- marginVertical: 10,
},
icon: {
marginRight: 10,
diff --git a/src/app/components/forms/FormField.js b/src/app/components/forms/FormField.js
index 60cc2f1..3c99d6c 100644
--- a/src/app/components/forms/FormField.js
+++ b/src/app/components/forms/FormField.js
@@ -3,12 +3,14 @@ import { useFormikContext } from "formik";
import TextInput from "../TextInput";
import ErrorMessage from "./ErrorMessage";
+import {View} from "react-native";
function AppFormField({ name, width, ...otherProps }) {
const { setFieldTouched, handleChange, errors, touched } = useFormikContext();
return (
- <>
+
setFieldTouched(name)}
onChangeText={handleChange(name)}
@@ -16,7 +18,7 @@ function AppFormField({ name, width, ...otherProps }) {
{...otherProps}
/>
- >
+
);
}
diff --git a/src/app/components/forms/FormImagePicker.js b/src/app/components/forms/FormImagePicker.js
index 58f66bf..20a2191 100644
--- a/src/app/components/forms/FormImagePicker.js
+++ b/src/app/components/forms/FormImagePicker.js
@@ -1,16 +1,13 @@
-import React, { useState } from "react";
+import React from "react";
import { useFormikContext } from "formik";
import ErrorMessage from "./ErrorMessage";
import ImageInputList from "../ImageInputList";
-import { View, Text, StyleSheet, Modal, Alert } from "react-native";
-import colors from "../../config/colors";
-import { dimensions } from "../../config/dimensions";
+import { View, Alert } from "react-native";
function FormImagePicker({ name }) {
const { errors, setFieldValue, touched, values } = useFormikContext();
const imageUris = values[name];
- const [modalVisible, setModalVisible] = useState(false);
const handleAdd = (uri) => {
if (imageUris.length === 0) {
@@ -55,23 +52,5 @@ function FormImagePicker({ name }) {
);
}
-const styles = StyleSheet.create({
- labelStyle: {
- fontSize: dimensions.text.secondary,
- fontWeight: "bold",
- textAlign: "left",
- color: colors.primary,
- marginBottom: 5,
- marginTop: 15,
- },
- centeredView: {
- flex: 1,
- justifyContent: "center",
- alignItems: "center",
- marginTop: 22,
- },
-});
-
-
export default FormImagePicker;
diff --git a/src/app/components/forms/SubmitButton.js b/src/app/components/forms/SubmitButton.js
index f4c02ea..068cdb8 100644
--- a/src/app/components/forms/SubmitButton.js
+++ b/src/app/components/forms/SubmitButton.js
@@ -2,11 +2,17 @@ import React from "react";
import { useFormikContext } from "formik";
import Button from "../Button";
+import {View} from "react-native";
function SubmitButton({ title }) {
const { handleSubmit } = useFormikContext();
- return ;
+ return (
+
+
+
+ );
}
export default SubmitButton;
diff --git a/src/app/screens/MapFeedScreen.js b/src/app/screens/MapFeedScreen.js
index 6d6413d..8948347 100644
--- a/src/app/screens/MapFeedScreen.js
+++ b/src/app/screens/MapFeedScreen.js
@@ -9,19 +9,19 @@ export default function MapFeedScreen() {
const focusChanged = attachFocusToQuery();
const [error, setError] = useState(false);
- useEffect(() => {
- loadForms();
- }, []);
+ // useEffect(() => {
+ // loadForms();
+ // }, []);
- const loadForms = async () => {
- const response = await formsApi.getForms();
- console.log(response);
- if (!response.ok) {
- console.log("resposta não ok!");
- return setError(true);
- }
- setError(false);
- }
+ // const loadForms = async () => {
+ // const response = await formsApi.getForms();
+ // console.log(response);
+ // if (!response.ok) {
+ // console.log("resposta não ok!");
+ // return setError(true);
+ // }
+ // setError(false);
+ // }
return (
diff --git a/src/app/screens/PluviometerSharingDataScreen.js b/src/app/screens/PluviometerSharingDataScreen.js
index 7481079..ca0d997 100644
--- a/src/app/screens/PluviometerSharingDataScreen.js
+++ b/src/app/screens/PluviometerSharingDataScreen.js
@@ -19,6 +19,7 @@ import moment from "moment";
import FormLocationPicker from "../components/forms/FormLocationPicker";
import { TouchableOpacity } from "react-native-gesture-handler";
import { EventLocationContext } from "../context/EventLocationContext";
+import PickEventDateLocation from "../components/PickEventDateLocation";
const dims = scaleDimsFromWidth(85, 85, 25);
@@ -92,26 +93,13 @@ function PluviometerSharingDataScreen(props) {
alignContent: "flex-start",
}}
>
- {/*Data da coleta:*/}
-
- setDateTime(value)}
- onTimeChange={(value) => setTime(value)}
- />
-
- {/*Local do evento:*/}
- {/* */}
- {/* props.navigation.navigate("FormMap")} */}
- {/* > */}
- {/* */}
- {/* */}
- {/* */}
+
+
Comentário:
@@ -133,7 +121,6 @@ function PluviometerSharingDataScreen(props) {
const styles = StyleSheet.create({
container: {
- padding: 10,
flex: 1,
},
image: {
@@ -143,6 +130,7 @@ const styles = StyleSheet.create({
alignItems: "center",
},
labelStyle: {
+ paddingHorizontal: 16,
fontSize: dimensions.text.secondary,
fontWeight: "bold",
textAlign: "left",
diff --git a/src/app/screens/RainSharingDataScreen.js b/src/app/screens/RainSharingDataScreen.js
index 2d885a1..0452567 100644
--- a/src/app/screens/RainSharingDataScreen.js
+++ b/src/app/screens/RainSharingDataScreen.js
@@ -1,5 +1,5 @@
import React, { useContext, useEffect, useState } from "react";
-import { StyleSheet, View, ScrollView, PixelRatio } from "react-native";
+import { StyleSheet, View, ScrollView } from "react-native";
import * as Yup from "yup";
import { Form, SubmitButton, FormField } from "../components/forms";
@@ -16,7 +16,8 @@ import moment from "moment";
import FormDatePicker from "../components/forms/FormDatePicker";
import FormLocationPicker from "../components/forms/FormLocationPicker";
import { EventLocationContext } from "../context/EventLocationContext";
-import {useIsFocused} from "@react-navigation/native";
+import { useIsFocused } from "@react-navigation/native";
+import PickEventDateLocation from "../components/PickEventDateLocation";
const validationSchema = Yup.object().shape({
images: Yup.array(),
@@ -62,13 +63,17 @@ function RainSharingDataScreen(props) {
duration: 1950,
icon: "success",
type: "success",
- onPress: () => { },
+ onPress: () => {},
});
props.navigation.navigate("Home");
}}
validationSchema={validationSchema}
>
-
+
setRain(0)}>
@@ -130,49 +135,22 @@ function RainSharingDataScreen(props) {
-
- {/*Data da coleta:*/}
-
- setDate(value)}
- onTimeChange={(value) => setTime(value)}
- />
-
- {/*Local do evento:*/}
-
- props.navigation.navigate("FormMap")}
- >
-
-
-
-
-
- Comentário:
-
-
+
+
+ Comentário:
+
+
+
@@ -182,7 +160,6 @@ function RainSharingDataScreen(props) {
const styles = StyleSheet.create({
container: {
- padding: 10,
backgroundColor: colors.white,
},
img_block: {
@@ -202,6 +179,7 @@ const styles = StyleSheet.create({
color: colors.danger,
},
labelStyle: {
+ paddingHorizontal: 16,
fontSize: dimensions.text.secondary,
fontWeight: "bold",
textAlign: "left",
diff --git a/src/app/screens/RiverFloodSharingDataScreen.js b/src/app/screens/RiverFloodSharingDataScreen.js
index 5a4a69a..11d2f77 100644
--- a/src/app/screens/RiverFloodSharingDataScreen.js
+++ b/src/app/screens/RiverFloodSharingDataScreen.js
@@ -23,6 +23,7 @@ import moment from "moment";
import FormDatePicker from "../components/forms/FormDatePicker";
import FormLocationPicker from "../components/forms/FormLocationPicker";
import { EventLocationContext } from "../context/EventLocationContext";
+import PickEventDateLocation from "../components/PickEventDateLocation";
const validationSchema = Yup.object().shape({
images: Yup.array(),
@@ -76,7 +77,7 @@ function RiverFloodSharingDataScreen(props) {
}}
validationSchema={validationSchema}
>
-
+
setRiverScale(0)}>
@@ -125,38 +126,11 @@ function RiverFloodSharingDataScreen(props) {
)}
+
-
- {/*Data da coleta:*/}
-
- setDate(value)}
- onTimeChange={(value) => setTime(value)}
- />
-
- {/*Local do evento:*/}
-
- props.navigation.navigate("FormMap")}
- >
-
-
-
-
Comentário:
-
- {/*Data da coleta:*/}
-
- setDate(value)}
- onTimeChange={(value) => setTime(value)}
- />
-
- {/*Local do evento:*/}
-
- props.navigation.navigate("FormMap")}
- >
-
-
-
-
-
- Comentário:
-
-
+
+
+ Comentário:
+
@@ -164,7 +144,7 @@ const dims = scaleDimsFromWidth(93, 106, 30.0);
const styles = StyleSheet.create({
container: {
- padding: 10,
+ // padding: 17,
backgroundColor: colors.white,
},
@@ -190,12 +170,14 @@ const styles = StyleSheet.create({
fontSize: dimensions.text.default,
},
error_txt: {
+ paddingHorizontal: 16,
fontSize: 18,
color: colors.danger,
},
labelStyle: {
fontSize: dimensions.text.secondary,
fontWeight: "bold",
+ paddingHorizontal: 16,
textAlign: "left",
color: colors.lightBlue,
},
diff --git a/src/package.json b/src/package.json
index 89a31a9..33bed79 100644
--- a/src/package.json
+++ b/src/package.json
@@ -51,6 +51,7 @@
"react-native-safe-area-context": "3.1.4",
"react-native-screens": "~2.10.1",
"react-native-searchable-dropdown": "^1.1.3",
+ "react-native-shadow-2": "^3.0.0",
"react-native-simple-dialogs": "^1.4.0",
"react-native-svg": "^12.1.0",
"react-native-svg-uri": "^1.2.3",