You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.9 KiB

import React from "react";
import { Appearance } from "react-native";
import Svg, { Path } from "react-native-svg";
import SelectDropdown from "react-native-select-dropdown";
//styles
import fontSize from "../constants/fontSize";
import Colors from "../constants/Colors";
function Select({
iconPosition,
options,
onChange,
name,
value,
width,
defaultValue,
}) {
const colorScheme = Appearance.getColorScheme();
3 years ago
return (
<SelectDropdown
data={options}
buttonStyle={{
width: width,
borderWidth: 1,
borderColor: Colors.theme1[colorScheme].gray2077 + "66",
3 years ago
borderRadius: 6,
height: 48,
backgroundColor: 'white',
fontFamily: "regular",
}}
rowTextStyle={{
fontSize: fontSize.sm,
fontFamily: "regular",
3 years ago
}}
defaultButtonText={defaultValue}
statusBarTranslucent={true}
buttonTextStyle={{
textAlign: "center",
justifyContent: "flex-end",
3 years ago
flex: 0,
fontSize: fontSize.tiny,
color: Colors.theme1[colorScheme].gray2077,
fontFamily: "regular",
3 years ago
// display: 'inline'
}}
dropdownIconPosition={iconPosition}
onSelect={(selectedItem) => {
onChange(name, selectedItem);
3 years ago
}}
renderDropdownIcon={() => (
<Svg
data-name="vuesax/linear/arrow-down"
xmlns="http://www.w3.org/2000/svg"
width={16.081}
height={16.081}
>
<Path
d="m13.347 5.997-4.368 4.369a1.331 1.331 0 0 1-1.876 0L2.734 5.997"
fill="none"
stroke={Colors.theme1[colorScheme].gray2077 + "66"}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</Svg>
3 years ago
)}
/>
);
}
export default Select;
Select.defaultProps = {
options: ["1", "2", "3"],
iconPosition: "left",
3 years ago
};