@widergy/mobile-ui 0.37.2 → 0.37.4

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,17 @@
1
+ ## [0.37.4](https://github.com/widergy/mobile-ui/compare/v0.37.3...v0.37.4) (2023-06-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * image radio ([#240](https://github.com/widergy/mobile-ui/issues/240)) ([d834b8c](https://github.com/widergy/mobile-ui/commit/d834b8c149b636e4c772ed02ecae8b517be61eea))
7
+
8
+ ## [0.37.3](https://github.com/widergy/mobile-ui/compare/v0.37.2...v0.37.3) (2023-03-11)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * update auto_assign.yml ([045b376](https://github.com/widergy/mobile-ui/commit/045b376432f822a4e0d719a62c32faabf850f1e9))
14
+
1
15
  ## [0.37.2](https://github.com/widergy/mobile-ui/compare/v0.37.1...v0.37.2) (2023-03-11)
2
16
 
3
17
 
@@ -5,9 +5,9 @@ import propTypes from './propTypes';
5
5
  import { getImageStyles } from './styles';
6
6
  import { DEFAULT_IMAGE_ICON_SIZE } from './constants';
7
7
 
8
- const ImageIcon = ({ containerStyle, image, size, style, theme, ...props }) => {
8
+ const ImageIcon = ({ containerStyle, image, size, style, theme, withUri = false, ...props }) => {
9
9
  const imageStyles = getImageStyles(size);
10
- return <Image resizeMode="contain" {...props} source={image} style={[imageStyles, style]} />;
10
+ return <Image resizeMode="contain" {...props} source={withUri ? {uri: image} : image} style={[imageStyles, style]} />;
11
11
  };
12
12
 
13
13
  ImageIcon.defaultProps = {
@@ -33,10 +33,19 @@ const ImageRadio = ({ options, title, onChange, value, style, variant = {} }) =>
33
33
  ]}
34
34
  >
35
35
  <View style={vertical ? styles.touchableInnerContainerVertical : styles.touchableInnerContainer}>
36
- <ImageIcon
36
+ {
37
+ !!option.configuration.selected_image_url && <ImageIcon
37
38
  size={IMAGE_SIZE}
38
- image={isSelected(option) ? option.selectedImage : option.unselectedImage}
39
+ image={isSelected(option) ? option.configuration.selected_image_url : option.configuration.image_url}
40
+ withUri={true}
39
41
  />
42
+ }
43
+ {
44
+ !!option?.configuration?.SelectedImageComponent && <ImageIcon
45
+ size={IMAGE_SIZE}
46
+ image={isSelected(option) ? option.configuration.SelectedImageComponent : option.configuration.UnselectedImageComponent}
47
+ />
48
+ }
40
49
  <View style={!vertical ? styles.labels : styles.verticalLabels}>
41
50
  <Label
42
51
  white={!transparentBackground && isSelected(option)}
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": "0.37.2",
5
+ "version": "0.37.4",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [