@holper/react-native-holper-storybook 0.6.34 → 0.6.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,13 +3,14 @@ import { View } from "react-native";
3
3
  import PropTypes from "prop-types";
4
4
  import DropDownPicker from "react-native-dropdown-picker";
5
5
  import style, {
6
- fontStyle,
7
6
  includesSelect,
8
7
  placeholderStyle,
9
8
  listItemLabelStyle,
10
9
  listItemContainerStyle,
11
10
  selectedItemLabelStyle,
11
+ textStyle,
12
12
  } from "./style";
13
+ import { useEffect } from "react";
13
14
 
14
15
  const Select = ({
15
16
  value,
@@ -21,6 +22,11 @@ const Select = ({
21
22
  placeholder,
22
23
  }) => {
23
24
  const [open, setOpen] = useState(false);
25
+ const [val, setVal] = useState(value);
26
+
27
+ useEffect(() => {
28
+ setVal(value);
29
+ }, [value]);
24
30
 
25
31
  return (
26
32
  <View
@@ -28,16 +34,16 @@ const Select = ({
28
34
  style.container,
29
35
  disabled ? style.disabled : {},
30
36
  fitToContainer ? style.fit : {},
31
- { zIndex: open ? 99 : 0 },
32
37
  ]}
33
38
  >
34
39
  <DropDownPicker
35
40
  style={includesSelect[variant]}
36
41
  open={open}
37
- value={value}
42
+ value={val}
38
43
  items={items}
39
44
  setOpen={setOpen}
40
- setValue={onValueChange}
45
+ setValue={setVal}
46
+ onSelectItem={(selected) => onValueChange(selected.value)}
41
47
  disabled={disabled}
42
48
  placeholder={placeholder}
43
49
  placeholderStyle={placeholderStyle}
@@ -45,13 +51,11 @@ const Select = ({
45
51
  listItemContainerStyle={listItemContainerStyle}
46
52
  selectedItemLabelStyle={selectedItemLabelStyle}
47
53
  listMode="MODAL"
48
- textStyle={fontStyle}
54
+ textStyle={textStyle}
49
55
  dropDownContainerStyle={{
50
56
  ...includesSelect[variant],
51
57
  height: "auto",
52
58
  }}
53
- zIndex={4000}
54
- zIndexReverse={1000}
55
59
  />
56
60
  </View>
57
61
  );
@@ -21,7 +21,7 @@ export default {
21
21
  },
22
22
  };
23
23
 
24
- export const fontStyle = {
24
+ const fontStyle = {
25
25
  color: Colors.darkblue,
26
26
  fontFamily: "poppins_regular",
27
27
  };
@@ -74,3 +74,8 @@ export const listItemContainerStyle = {
74
74
  export const selectedItemLabelStyle = {
75
75
  fontFamily: "poppins_semiBold",
76
76
  };
77
+
78
+ export const textStyle = {
79
+ ...fontStyle,
80
+ fontSize: 16,
81
+ };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "main": "lib/index.js",
3
3
  "name": "@holper/react-native-holper-storybook",
4
4
  "description": "A component library for Holper projects",
5
- "version": "0.6.34",
5
+ "version": "0.6.36",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "lib",