|
@ -3,7 +3,6 @@ import { StyleSheet, View } from "react-native"; |
|
|
|
|
|
|
|
|
import colors from "../config/colors"; |
|
|
import colors from "../config/colors"; |
|
|
import DropDownPicker from "react-native-dropdown-picker"; |
|
|
import DropDownPicker from "react-native-dropdown-picker"; |
|
|
import { Shadow } from "react-native-shadow-2"; |
|
|
|
|
|
import { useFormikContext } from "formik"; |
|
|
import { useFormikContext } from "formik"; |
|
|
import { ErrorMessage } from "./forms"; |
|
|
import { ErrorMessage } from "./forms"; |
|
|
import defaultStyles from "../config/styles"; |
|
|
import defaultStyles from "../config/styles"; |
|
@ -16,6 +15,7 @@ function DropDown({ |
|
|
formPlaceholder, |
|
|
formPlaceholder, |
|
|
searchPlaceholder, |
|
|
searchPlaceholder, |
|
|
nothingToShow, |
|
|
nothingToShow, |
|
|
|
|
|
doubleItemLine, |
|
|
}) { |
|
|
}) { |
|
|
const [open, setOpen] = useState(false); |
|
|
const [open, setOpen] = useState(false); |
|
|
|
|
|
|
|
@ -54,6 +54,16 @@ function DropDown({ |
|
|
modalProps={{ |
|
|
modalProps={{ |
|
|
animationType: "fade", |
|
|
animationType: "fade", |
|
|
}} |
|
|
}} |
|
|
|
|
|
selectedItemLabelStyle={{ |
|
|
|
|
|
fontWeight: "bold", |
|
|
|
|
|
}} |
|
|
|
|
|
listItemContainerStyle={ |
|
|
|
|
|
doubleItemLine && { |
|
|
|
|
|
marginVertical: 5, |
|
|
|
|
|
numberOfLines: 3, |
|
|
|
|
|
height: 50, |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
/> |
|
|
/> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
@ -68,6 +78,7 @@ function SearchablePicker({ |
|
|
nothingToShow = "Não encontramos nada com esse termo", |
|
|
nothingToShow = "Não encontramos nada com esse termo", |
|
|
marginRight = 2, |
|
|
marginRight = 2, |
|
|
marginLeft = 16, |
|
|
marginLeft = 16, |
|
|
|
|
|
doubleItemLine = false, |
|
|
}) { |
|
|
}) { |
|
|
const { values, setFieldValue, errors, touched } = name |
|
|
const { values, setFieldValue, errors, touched } = name |
|
|
? useFormikContext() |
|
|
? useFormikContext() |
|
@ -95,6 +106,7 @@ function SearchablePicker({ |
|
|
formPlaceholder={formPlaceholder} |
|
|
formPlaceholder={formPlaceholder} |
|
|
searchPlaceholder={searchPlaceholder} |
|
|
searchPlaceholder={searchPlaceholder} |
|
|
nothingToShow={nothingToShow} |
|
|
nothingToShow={nothingToShow} |
|
|
|
|
|
doubleItemLine={doubleItemLine} |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
{name && <ErrorMessage error={errors[name]} visible={touched[name]} />} |
|
|
{name && <ErrorMessage error={errors[name]} visible={touched[name]} />} |
|
|