@widergy/mobile-ui 0.37.3 → 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,10 @@
|
|
|
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
|
+
|
|
1
8
|
## [0.37.3](https://github.com/widergy/mobile-ui/compare/v0.37.2...v0.37.3) (2023-03-11)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -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
|
-
|
|
36
|
+
{
|
|
37
|
+
!!option.configuration.selected_image_url && <ImageIcon
|
|
37
38
|
size={IMAGE_SIZE}
|
|
38
|
-
image={isSelected(option) ? option.
|
|
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