-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: render embedded images in credential subject (#351)
* refactor: extract credential subject into file * feat: render `image` instead of displaying it as text * refactor: use `portrait` instead of `image` * style: fix clippy issue * fix: align field styling with UI designs * feat: add renderer for simple text fields, distinguish based on credential type * refactor: add renderer, set white background for all logos * fix: enable feature `webview-data-url` * security: allow `data:` image source through CSP * fix: typo * fix: apply `background` and `background-alt` correctly * refactor: adjust top nav bar * fix: add white background to issuer logo * fix: contain image within fixed height * test: add embedded image to test fixture
- Loading branch information
1 parent
42573bb
commit 5f29c21
Showing
14 changed files
with
69 additions
and
25 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
identity-wallet/resources/ferris-drivers-license-payload.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
unime/src-tauri/tests/fixtures/states/four_credentials_redirect_me.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
unime/src/routes/credentials/[id]/DataUrlImageRenderer.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
export let key: string; | ||
export let dataUrl: string; | ||
</script> | ||
|
||
<!-- | ||
@component | ||
This renderer for `credentialSubject` fields renders an embedded image for a given [Data URL](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). | ||
--> | ||
<div class="flex flex-col items-start rounded-xl bg-background px-4 py-3 text-[13px]/[24px]"> | ||
<h2 class="w-full font-medium text-text-alt">{key}</h2> | ||
<img src={dataUrl} alt="embedded" class="my-1 h-32 rounded-md object-contain" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters