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