@widergy/mobile-ui 1.32.0 → 1.32.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.32.1](https://github.com/widergy/mobile-ui/compare/v1.32.0...v1.32.1) (2024-11-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [UG-2249] disabled prop added in UTSwitch ([#388](https://github.com/widergy/mobile-ui/issues/388)) ([49181f4](https://github.com/widergy/mobile-ui/commit/49181f45b61662dbedc31c377f9b013ec4a5efa5))
7
+
1
8
  # [1.32.0](https://github.com/widergy/mobile-ui/compare/v1.31.3...v1.32.0) (2024-11-06)
2
9
 
3
10
 
@@ -9,6 +9,7 @@ import ownStyles from './styles';
9
9
  import switchProptypes from './proptypes';
10
10
 
11
11
  const UTSwitch = ({
12
+ disabled,
12
13
  style,
13
14
  onColor,
14
15
  offColor,
@@ -96,7 +97,7 @@ const UTSwitch = ({
96
97
 
97
98
  return (
98
99
  <TouchableWithoutFeedback
99
- disabled={disablePress}
100
+ disabled={disablePress || disabled}
100
101
  onPressIn={onClick}
101
102
  onPressOut={onClickEnd}
102
103
  hitSlop={hitSlop}
@@ -116,6 +117,7 @@ const UTSwitch = ({
116
117
  ]
117
118
  })
118
119
  },
120
+ disabled && ownStyles.disabled,
119
121
  style
120
122
  ]}
121
123
  >
@@ -1,7 +1,8 @@
1
- import { string, func, any, shape, number } from 'prop-types';
1
+ import { string, func, any, shape, number, bool } from 'prop-types';
2
2
  import { ViewPropTypes } from 'deprecated-react-native-prop-types';
3
3
 
4
4
  export default {
5
+ disabled: bool,
5
6
  style: ViewPropTypes.style,
6
7
  onColor: string,
7
8
  offColor: string,
@@ -12,5 +12,8 @@ export default StyleSheet.create({
12
12
  backgroundColor: 'red',
13
13
  position: 'absolute',
14
14
  zIndex: -1
15
+ },
16
+ disabled: {
17
+ opacity: 0.5
15
18
  }
16
19
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@widergy/mobile-ui",
3
3
  "description": "Widergy Mobile Components",
4
4
  "author": "widergy",
5
- "version": "1.32.0",
5
+ "version": "1.32.1",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [