Skip to content

Commit 2e069f6

Browse files
committed
Add image fallback for NFC based VCs.
1 parent b4124b3 commit 2e069f6

File tree

4 files changed

+33
-8
lines changed

4 files changed

+33
-8
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# bedrock-vue-wallet ChangeLog
22

3+
## 29.5.1 - 2024-10-xx
4+
5+
### Added
6+
- Add description for NFC platform support.
7+
8+
### Fixed
9+
- Add credential image fallback for NFC renderable VCs.
10+
311
## 29.5.0 - 2024-10-18
412

513
### Added

components/CredentialCardBundle.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div class="row justify-between">
2323
<dynamic-image
2424
class="q-mr-auto"
25-
:src="credentialOverrides.image"
25+
:src="credentialOverrides.image || credentialImage"
2626
size="md" />
2727
<!-- eslint-disable vue/no-v-html
2828
this is ok to disable only because `contactlessSvg` has been
@@ -96,7 +96,9 @@ import {
9696
ageCredentialHelpers, getCredentialStore, helpers
9797
} from '@bedrock/web-wallet';
9898
import {computed, onBeforeMount, reactive, ref} from 'vue';
99-
import {CredentialSwitch, DynamicImage} from '@bedrock/vue-vc';
99+
import {
100+
CredentialSwitch, DynamicImage, useCredentialCommon
101+
} from '@bedrock/vue-vc';
100102
import {formatString, getValueFromPointer} from '../lib/helpers.js';
101103
import {config} from '@bedrock/web';
102104
import {svg as contactlessSvg} from './contactless.js';
@@ -364,6 +366,10 @@ export default {
364366
return newCredentialSubject;
365367
}
366368
369+
const {credentialImage} = useCredentialCommon({
370+
credential: props.credentialRecord.credential
371+
});
372+
367373
return {
368374
card,
369375
hover,
@@ -380,6 +386,7 @@ export default {
380386
toggleDetailsWindow,
381387
credentialHighlights,
382388
credentialHolderName,
389+
credentialImage,
383390
contactlessSvg,
384391
hasNFCPayload
385392
};

components/CredentialDetails.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<div class="row justify-between">
3535
<dynamic-image
3636
class="q-mr-auto"
37-
:src="credentialOverrides.image"
37+
:src="credentialOverrides.image || credentialImage"
3838
size="md" />
3939
<!-- eslint-disable vue/no-v-html
4040
this is ok to disable only because `contactlessSvg` has
@@ -128,7 +128,9 @@
128128
* Copyright (c) 2015-2024 Digital Bazaar, Inc. All rights reserved.
129129
*/
130130
import {computed, ref} from 'vue';
131-
import {CredentialSwitch, DynamicImage} from '@bedrock/vue-vc';
131+
import {
132+
CredentialSwitch, DynamicImage, useCredentialCommon
133+
} from '@bedrock/vue-vc';
132134
import {svg as contactlessSvg} from './contactless.js';
133135
import CredentialDetailsViews from './CredentialDetailsViews.vue';
134136
import {helpers} from '@bedrock/web-wallet';
@@ -208,9 +210,14 @@ export default {
208210
nfcShareComponent.value.cancelWrite();
209211
}
210212
213+
const {credentialImage} = useCredentialCommon({
214+
credential: props.credential
215+
});
216+
211217
return {
212218
cancelWrite,
213219
contactlessSvg,
220+
credentialImage,
214221
showDelete,
215222
description,
216223
hasNFCPayload,

components/NfcShare.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@
1111
<template #default>
1212
<div class="row justify-between items-center">
1313
<!-- eslint-disable vue/no-v-html
14-
this is ok to disable only because `contactlessSvg` has been
15-
specifically sanitized -->
14+
this is ok to disable only because `contactlessSvg` has been
15+
specifically sanitized -->
1616
<div
17-
style="height: 24px; margin-right: 8px;"
18-
v-html="contactlessSvg" />
17+
style="height: 24px; margin-right: 8px;"
18+
v-html="contactlessSvg" />
1919
<!-- eslint-enable -->
2020
<div>
2121
Tap to Share
2222
</div>
2323
</div>
24+
<q-tooltip>
25+
Tap to Share is only available on Android devices.
26+
</q-tooltip>
2427
</template>
2528
</q-btn>
2629
</div>

0 commit comments

Comments
 (0)