From ce1d32a8061f15cb85dfc268ba5850b1aa2782c3 Mon Sep 17 00:00:00 2001 From: Aaron Loe Date: Wed, 16 Jul 2025 09:43:14 -0700 Subject: [PATCH] feat: optional walletLabel key card - the new UI will allow users to create keycards before specifying a wallet label, so we need to make this field optional & not render the label if its not specified Ticket: CE-6422 --- modules/key-card/src/drawKeycard.ts | 20 +++++++++++++------ modules/key-card/src/index.ts | 6 ++++-- modules/key-card/src/types.ts | 2 +- .../src/components/KeyCard/fixtures.ts | 4 ++-- .../web-demo/src/components/KeyCard/index.tsx | 7 +++++-- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/modules/key-card/src/drawKeycard.ts b/modules/key-card/src/drawKeycard.ts index 12a3723dbe..a37d093b9c 100644 --- a/modules/key-card/src/drawKeycard.ts +++ b/modules/key-card/src/drawKeycard.ts @@ -149,12 +149,20 @@ export async function drawKeycard({ const date = new Date().toDateString(); y = moveDown(y, margin); doc.setFontSize(font.body).setTextColor(color.gray); - const title = curve ? KeyCurveName[curve] + ' key:' : 'wallet named:'; - doc.text('Created on ' + date + ' for ' + title, left(0), y); - // copy - y = moveDown(y, 25); - doc.setFontSize(font.subheader).setTextColor(color.black); - doc.text(walletLabel, left(0), y); + + if (curve || walletLabel) { + const title = curve ? KeyCurveName[curve] + ' key:' : 'wallet named:'; + doc.text('Created on ' + date + ' for ' + title, left(0), y); + // copy + y = moveDown(y, 25); + if (walletLabel) { + doc.setFontSize(font.subheader).setTextColor(color.black); + doc.text(walletLabel, left(0), y); + } + } else { + doc.text('Created on ' + date, left(0), y); + y = moveDown(y, 25); + } if (!curve) { // Red Bar y = moveDown(y, 20); diff --git a/modules/key-card/src/index.ts b/modules/key-card/src/index.ts index fbbe764298..36a6cd02b1 100644 --- a/modules/key-card/src/index.ts +++ b/modules/key-card/src/index.ts @@ -15,11 +15,13 @@ export async function generateKeycard(params: GenerateKeycardParams): Promise {

Key Card


- +