@sphereon/ui-components.ssi-react-native 0.2.1-unstable.46 → 0.2.1-unstable.48
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.
|
@@ -5,10 +5,25 @@ import SSIPlaceholderLogo from '../SSIPlaceholderLogo';
|
|
|
5
5
|
const SSILogo = (props) => {
|
|
6
6
|
const { logo, color = logoColors.default, size = 32, style } = props;
|
|
7
7
|
const source = { ...logo, priority: FastImage.priority.high };
|
|
8
|
+
let calculatedHeight = size;
|
|
9
|
+
let calculatedWidth = size;
|
|
10
|
+
if (logo?.dimensions) {
|
|
11
|
+
const aspectRatio = calculateAspectRatio(logo.dimensions.width, logo.dimensions.height);
|
|
12
|
+
if (logo.dimensions.width >= logo.dimensions.height) {
|
|
13
|
+
calculatedWidth = size;
|
|
14
|
+
calculatedHeight = size / aspectRatio;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
calculatedHeight = size;
|
|
18
|
+
calculatedWidth = size * aspectRatio;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
8
21
|
return logo ? (<FastImage style={{
|
|
9
22
|
...style,
|
|
10
|
-
|
|
11
|
-
|
|
23
|
+
height: calculatedHeight > size ? size : calculatedHeight,
|
|
24
|
+
width: calculatedWidth > size ? size : calculatedWidth,
|
|
25
|
+
maxWidth: size,
|
|
26
|
+
maxHeight: size,
|
|
12
27
|
}} resizeMode={FastImage.resizeMode.contain} source={source}/>) : (<SSIPlaceholderLogo style={style} size={size} color={color}/>);
|
|
13
28
|
};
|
|
14
29
|
export default SSILogo;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ui-components.ssi-react-native",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.2.1-unstable.
|
|
4
|
+
"version": "0.2.1-unstable.48+6cb50a1",
|
|
5
5
|
"description": "SSI UI components for React-Native",
|
|
6
6
|
"repository": "git@github.com:Sphereon-Opensource/UI-Components.git",
|
|
7
7
|
"author": "Sphereon <dev@sphereon.com>",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@react-native-community/blur": "^4.4.0",
|
|
32
32
|
"@react-native-masked-view/masked-view": "0.3.1",
|
|
33
|
-
"@sphereon/ui-components.core": "0.2.1-unstable.
|
|
33
|
+
"@sphereon/ui-components.core": "0.2.1-unstable.48+6cb50a1",
|
|
34
34
|
"expo-linear-gradient": "~12.7.2",
|
|
35
35
|
"react-native-fast-image": "^8.6.3",
|
|
36
36
|
"react-native-size-matters": "^0.4.0",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react": ">= 18",
|
|
49
49
|
"react-native": "~0.73.6"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "6cb50a157b9339ce3bd221b0d9c9bdb52411c306"
|
|
52
52
|
}
|