diff --git a/packages/agent/src/display.ts b/packages/agent/src/display.ts index 974f1752..c6e75550 100644 --- a/packages/agent/src/display.ts +++ b/packages/agent/src/display.ts @@ -289,13 +289,11 @@ export function getCredentialForDisplay(credentialRecord: W3cCredentialRecord | const issuerDisplay = getSdJwtIssuerDisplay(openId4VcMetadata) const credentialDisplay = getSdJwtCredentialDisplay(decodedPayload, openId4VcMetadata) - // TODO: should we add a way to see these claims? Currently matching what would - // be included in a w3c credential subject + // TODO: We should map these claims to nice format and names // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { _sd_alg, _sd_hash, iss, vct, cnf, ...visibleProperties } = decodedPayload + const { _sd_alg, _sd_hash, iss, vct, cnf, iat, exp, ...visibleProperties } = decodedPayload // TODO: display somehow which fields can be selective disclosed - return { id: `sd-jwt-vc-${credentialRecord.id}` satisfies CredentialForDisplayId, createdAt: credentialRecord.createdAt, diff --git a/packages/app/components/CredentialCard.tsx b/packages/app/components/CredentialCard.tsx index eb4dde84..226e6909 100644 --- a/packages/app/components/CredentialCard.tsx +++ b/packages/app/components/CredentialCard.tsx @@ -69,6 +69,7 @@ export default function CredentialCard({ }} h="$16" onPress={onPress} + overflow="hidden" > @@ -105,7 +106,13 @@ export default function CredentialCard({ {hasInternet ? ( - {backgroundImage.altText} + {backgroundImage.altText} ) : ( diff --git a/packages/app/utils/formatCredentialSubject.ts b/packages/app/utils/formatCredentialSubject.ts index aea57c50..96981e00 100644 --- a/packages/app/utils/formatCredentialSubject.ts +++ b/packages/app/utils/formatCredentialSubject.ts @@ -62,10 +62,16 @@ export function formatCredentialSubject( image: value, type: 'image', }) - } else if (typeof value === 'string') { + } else if (typeof value === 'string' || typeof value === 'number') { stringRows.push({ key: sanitizeString(key), - value: value, + value: `${value}`, + type: 'string', + }) + } else if (typeof value === 'boolean') { + stringRows.push({ + key: sanitizeString(key), + value: value ? 'Yes' : 'No', type: 'string', }) } diff --git a/packages/utils/src/format.ts b/packages/utils/src/format.ts index f7ac220e..6edd8592 100644 --- a/packages/utils/src/format.ts +++ b/packages/utils/src/format.ts @@ -11,7 +11,7 @@ export function capitalizeFirstLetter(string: string) { * i.e. sanitizeString("helloWorld") // returns: 'Hello world' */ export function sanitizeString(str: string) { - const result = str.replace(/([a-z0-9])([A-Z])/g, '$1 $2') + const result = str.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replaceAll('_', ' ') let words = result.split(' ') words = words.map((word, index) => { if (index === 0 || word.toUpperCase() === word) {