Skip to content

Commit

Permalink
refector: modified condition and keys
Browse files Browse the repository at this point in the history
Signed-off-by: tusharbhayani <[email protected]>
  • Loading branch information
tusharbhayani committed Dec 26, 2024
1 parent a5e09ba commit b641a02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/components/OpenId/OpenIDProofPresentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ const OpenIDProofPresentation: React.FC<OpenIDProofPresentationProps> = ({
<View style={{ marginTop: 16, gap: 8 }}>
{credential.description && <Text style={TextTheme.labelSubtitle}>{credential.description}</Text>}
<View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
{selectedCredential.requestedAttributes.map(a => (
<View key={a} style={{ flexBasis: '50%' }}>
<Text style={TextTheme.normal}>{sanitizeString(a)}</Text>
{selectedCredential.requestedAttributes.map(attribute => (
<View key={attribute} style={{ flexBasis: '50%' }}>
<Text style={TextTheme.normal}>{sanitizeString(attribute)}</Text>
</View>
))}
</View>
Expand Down
11 changes: 6 additions & 5 deletions app/screens/OpenID4VCProofChangeCredential.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ const OpenID4VCProofChangeCredential: React.FC<ProofChangeProps> = ({ route, nav
const renderCredential = ({ item }: { item: any }) => {
const displayItems = [
{ label: 'Issuer', value: item?.issuerName },
...Object.entries(item?.disclosedPayload || {}).map(([key, value]) => ({
label: key.charAt(0).toUpperCase() + key.slice(1), // Capitalize key
value: value?.toString() ?? '',
})),
...Object.entries(item?.disclosedPayload || {})
.filter(([key]) => key.toLowerCase() !== 'id') // Exclude the "Id" field
.map(([key, value]) => ({
label: key.charAt(0).toUpperCase() + key.slice(1), // Capitalize the key
value: value?.toString() ?? '',
})),
]

return (
<View style={styles.pageMargin}>
<View
Expand Down

0 comments on commit b641a02

Please sign in to comment.