From 33c62ba1eaad7115def4403fcefc6c41f258a619 Mon Sep 17 00:00:00 2001 From: PatMulligan <43773168+PatMulligan@users.noreply.github.com> Date: Mon, 15 Sep 2025 08:48:13 +0200 Subject: [PATCH] CHORE: Improve UI (#112) * Refactor merchant details layout for improved responsiveness and styling in index.html * Revamp key pair component layout with improved styling and functionality. Added a header with a toggle for showing the private key, enhanced QR code display for both public and private keys, and included copy buttons for better user interaction. Update key pair component styling and functionality: adjust QR code dimensions, improve key display format with truncation, and refine button margins for enhanced user experience. Add 'show-buttons' prop to QR code components in key pair template for improved functionality Update key pair component layout to use 'col-sm-6' for responsive design of QR code sections, enhancing display on smaller screens. * Enhance direct messages component layout with improved styling and responsiveness. Updated class names for better alignment, added ellipsis for long customer labels, and modified button styles for consistency. Improved select options display with custom templates for better user experience. * Refactor customer label generation in direct messages component for improved readability. Added checks for undefined customer data, enhanced label formatting with truncation for long descriptions, and adjusted unread message display format. * make format --- static/components/direct-messages.js | 15 ++- .../components/direct-messages.html | 38 ++++-- .../nostrmarket/components/key-pair.html | 113 +++++++++++++----- .../nostrmarket/components/stall-list.html | 1 - templates/nostrmarket/index.html | 35 +++--- 5 files changed, 138 insertions(+), 64 deletions(-) diff --git a/static/components/direct-messages.js b/static/components/direct-messages.js index b9dee13..3bb1aa0 100644 --- a/static/components/direct-messages.js +++ b/static/components/direct-messages.js @@ -50,13 +50,16 @@ window.app.component('direct-messages', { methods: { sendMessage: async function () {}, buildCustomerLabel: function (c) { - let label = `${c.profile.name || 'unknown'} ${c.profile.about || ''}` - if (c.unread_messages) { - label += `[new: ${c.unread_messages}]` + if (!c) return '' + let label = c.profile.name || 'unknown' + if (c.profile.about) { + label += ` - ${c.profile.about.substring(0, 30)}` + if (c.profile.about.length > 30) label += '...' } - label += ` (${c.public_key.slice(0, 16)}...${c.public_key.slice( - c.public_key.length - 16 - )}` + if (c.unread_messages) { + label = `[${c.unread_messages} new] ${label}` + } + label += ` (${c.public_key.slice(0, 8)}...${c.public_key.slice(-8)})` return label }, getDirectMessages: async function (pubkey) { diff --git a/templates/nostrmarket/components/direct-messages.html b/templates/nostrmarket/components/direct-messages.html index 8950923..9f68511 100644 --- a/templates/nostrmarket/components/direct-messages.html +++ b/templates/nostrmarket/components/direct-messages.html @@ -1,22 +1,22 @@