@procivis/one-react-native-components 0.3.143 → 0.3.147
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/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +6 -3
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-header.js +8 -38
- package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-logo.js +71 -0
- package/lib/commonjs/ui-components/credential/card/credential-logo.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/index.js +7 -0
- package/lib/commonjs/ui-components/credential/card/index.js.map +1 -1
- package/lib/commonjs/ui-components/input/selection-input.js +69 -53
- package/lib/commonjs/ui-components/input/selection-input.js.map +1 -1
- package/lib/commonjs/ui-components/text/index.js +1 -9
- package/lib/commonjs/ui-components/text/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/transaction.js +20 -0
- package/lib/commonjs/utils/hooks/core/transaction.js.map +1 -0
- package/lib/commonjs/utils/parsers/credential.js +22 -14
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +1 -1
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js +6 -3
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-header.js +8 -38
- package/lib/module/ui-components/credential/card/credential-header.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-logo.js +64 -0
- package/lib/module/ui-components/credential/card/credential-logo.js.map +1 -0
- package/lib/module/ui-components/credential/card/index.js +2 -0
- package/lib/module/ui-components/credential/card/index.js.map +1 -1
- package/lib/module/ui-components/input/selection-input.js +70 -54
- package/lib/module/ui-components/input/selection-input.js.map +1 -1
- package/lib/module/ui-components/text/index.js +2 -2
- package/lib/module/ui-components/text/index.js.map +1 -1
- package/lib/module/utils/hooks/core/transaction.js +13 -0
- package/lib/module/utils/hooks/core/transaction.js.map +1 -0
- package/lib/module/utils/parsers/credential.js +20 -13
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +1 -1
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/typescript/ui-components/credential/card/credential-logo.d.ts +17 -0
- package/lib/typescript/ui-components/credential/card/index.d.ts +3 -0
- package/lib/typescript/ui-components/input/selection-input.d.ts +3 -7
- package/lib/typescript/ui-components/text/index.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/transaction.d.ts +2 -0
- package/lib/typescript/utils/parsers/credential.d.ts +2 -1
- package/package.json +5 -3
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +3 -0
- package/src/ui-components/credential/card/credential-header.tsx +9 -37
- package/src/ui-components/credential/card/credential-logo.stories.tsx +45 -0
- package/src/ui-components/credential/card/credential-logo.tsx +79 -0
- package/src/ui-components/credential/card/index.ts +5 -8
- package/src/ui-components/input/selection-input.tsx +85 -65
- package/src/ui-components/text/index.ts +2 -1
- package/src/utils/hooks/core/transaction.ts +18 -0
- package/src/utils/parsers/credential.ts +27 -13
- package/src/utils/parsers/query.ts +1 -0
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
CredentialCardProps,
|
|
20
20
|
CredentialDetailsCardProps,
|
|
21
21
|
CredentialHeaderProps,
|
|
22
|
+
CredentialLogoProps,
|
|
22
23
|
} from '../../ui-components/credential';
|
|
23
24
|
import { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';
|
|
24
25
|
import {
|
|
@@ -86,6 +87,30 @@ const formatCredentialDetail = (
|
|
|
86
87
|
return attributeValue.value ?? '';
|
|
87
88
|
};
|
|
88
89
|
|
|
90
|
+
export const credentialLogoFromCredential = (
|
|
91
|
+
credential: CredentialDetail,
|
|
92
|
+
config: CoreConfig,
|
|
93
|
+
testID: string,
|
|
94
|
+
language: string | undefined,
|
|
95
|
+
): Omit<CredentialLogoProps, 'size'> => {
|
|
96
|
+
const { layoutProperties } = credential.schema;
|
|
97
|
+
const defaultLanguage = config.globalSettings.defaultLanguage;
|
|
98
|
+
return {
|
|
99
|
+
color: layoutProperties?.logo?.backgroundColor,
|
|
100
|
+
credentialName:
|
|
101
|
+
getTranslatedLabel(credential.schema.translations?.name, language, defaultLanguage) ?? credential.schema.name,
|
|
102
|
+
icon: layoutProperties?.logo?.image
|
|
103
|
+
? {
|
|
104
|
+
imageSource: {
|
|
105
|
+
uri: layoutProperties.logo.image,
|
|
106
|
+
},
|
|
107
|
+
}
|
|
108
|
+
: undefined,
|
|
109
|
+
iconLabelColor: layoutProperties?.logo?.fontColor,
|
|
110
|
+
testID,
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
|
|
89
114
|
export const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {
|
|
90
115
|
const mdocMsoValidityIssue = Boolean(
|
|
91
116
|
credential.mdocMsoValidity?.nextUpdate && new Date(credential.mdocMsoValidity.nextUpdate) < new Date(),
|
|
@@ -174,6 +199,7 @@ export const cardHeaderFromCredential = (
|
|
|
174
199
|
labels: CardHeaderLabels,
|
|
175
200
|
language: string | undefined,
|
|
176
201
|
): Omit<CredentialHeaderProps, 'style'> => {
|
|
202
|
+
const logoProps = credentialLogoFromCredential(credential, config, '', language);
|
|
177
203
|
const {
|
|
178
204
|
credentialDetailPrimary,
|
|
179
205
|
credentialDetailSecondary,
|
|
@@ -181,25 +207,13 @@ export const cardHeaderFromCredential = (
|
|
|
181
207
|
credentialDetailTestID,
|
|
182
208
|
statusIcon,
|
|
183
209
|
} = credentialDetailFromCredential(credential, claims, config, testID, labels, language);
|
|
184
|
-
const { layoutProperties } = credential.schema;
|
|
185
|
-
const defaultLanguage = config.globalSettings.defaultLanguage;
|
|
186
210
|
|
|
187
211
|
return {
|
|
188
|
-
|
|
212
|
+
...logoProps,
|
|
189
213
|
credentialDetailErrorColor,
|
|
190
214
|
credentialDetailPrimary,
|
|
191
215
|
credentialDetailSecondary,
|
|
192
216
|
credentialDetailTestID,
|
|
193
|
-
credentialName:
|
|
194
|
-
getTranslatedLabel(credential.schema.translations?.name, language, defaultLanguage) ?? credential.schema.name,
|
|
195
|
-
icon: layoutProperties?.logo?.image
|
|
196
|
-
? {
|
|
197
|
-
imageSource: {
|
|
198
|
-
uri: layoutProperties.logo.image,
|
|
199
|
-
},
|
|
200
|
-
}
|
|
201
|
-
: undefined,
|
|
202
|
-
iconLabelColor: layoutProperties?.logo?.fontColor,
|
|
203
217
|
statusIcon,
|
|
204
218
|
testID,
|
|
205
219
|
};
|