dhre-ui-kit 0.0.47 → 0.0.49

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dhre-ui-kit",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "main": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -10,4 +10,6 @@ export interface CustomSwitchBtnProps {
10
10
  containerStyle?: ViewStyle;
11
11
  activeTextStyle?: TextStyle;
12
12
  inActiveTextStyle?: TextStyle;
13
+ disabled?: boolean;
14
+ circleStyle?: ViewStyle;
13
15
  }
@@ -8,6 +8,7 @@ import styles from './customSwitchBtn.styles';
8
8
  const CustomSwitchBtn = ({
9
9
  value,
10
10
  onValueChange,
11
+ disabled = false,
11
12
  activeText,
12
13
  activeTextVariant = FontStyle.L2_BOLD,
13
14
  inActiveText,
@@ -15,6 +16,7 @@ const CustomSwitchBtn = ({
15
16
  containerStyle,
16
17
  activeTextStyle,
17
18
  inActiveTextStyle,
19
+ circleStyle,
18
20
  }: CustomSwitchBtnProps) => {
19
21
  const [animatedValue] = useState(new Animated.Value(value ? 1 : 0));
20
22
 
@@ -31,15 +33,16 @@ const CustomSwitchBtn = ({
31
33
  }, [value]);
32
34
 
33
35
  const toggleSwitch = () => {
34
- const newValue = !value;
35
-
36
- onValueChange(newValue);
36
+ onValueChange(!value);
37
37
  };
38
38
  return (
39
39
  <Pressable
40
+ disabled={disabled}
40
41
  onPress={toggleSwitch}
41
42
  style={{...styles.mainContainer, ...containerStyle}}>
42
- <Animated.View style={[styles.circle, {transform: [{translateX}]}]} />
43
+ <Animated.View
44
+ style={[styles.circle, {transform: [{translateX}], ...circleStyle}]}
45
+ />
43
46
  <CustomTypography
44
47
  style={[styles.activeText, value ? inActiveTextStyle : activeTextStyle]}
45
48
  text={activeText}
@@ -1,3 +1 @@
1
- import CustomSwitchBtn from './customSwitchBtn';
2
-
3
- export default {CustomSwitchBtn};
1
+ export {default} from './customSwitchBtn';