Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 54 additions & 8 deletions src/components/addressBook/AddressBookPage.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="address-book-container">
<div class="header">
<h1><NotebookTabs :size="24" class="header-icon" />Address Book</h1>
<div class="address-book-container" :class="{ 'address-book-container--embedded': embedded }">
<div class="header" :class="{ 'header--embedded': embedded }">
<h1 v-if="!embedded"><NotebookTabs :size="24" class="header-icon" />Address Book</h1>
<div class="actions">
<button class="btn" @click="openAddContactModal(null)"><SquareUser :size="18" class="btn-icon" />Add Contact</button>
<ImportButton @contacts-imported="addContacts" />
Expand Down Expand Up @@ -172,6 +172,8 @@ import { NotebookTabs, SquareUser } from 'lucide-vue-next';
import { getContacts, addContact, deleteContact, type Contact } from '@/services/addressBook/contactService';
import { addWallet, getWalletCountForContact } from '@/services/addressBook/walletService';

withDefaults(defineProps<{ embedded?: boolean }>(), { embedded: false });

interface DisplayContact extends Contact {
wallets: number;
}
Expand Down Expand Up @@ -467,13 +469,27 @@ function onExportVcf(contact: Contact) {
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.address-book-container--embedded {
max-width: none;
margin: 0;
padding: 0;
background: transparent;
box-shadow: none;
border-radius: 0;
}

.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}

.header--embedded {
justify-content: flex-end;
margin-bottom: 1rem;
}

.sub-header {
display: flex;
justify-content: flex-end;
Expand All @@ -500,29 +516,59 @@ function onExportVcf(contact: Contact) {
flex-shrink: 0;
}

/* Default button chrome (footer delete, etc.); toolbar uses `.actions` rules below */
.btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
border-radius: 0.375rem;
border: 1px solid #d1d5db;
background-color: #ffffff;
cursor: pointer;
color: #1f2937;
font-weight: 500;
font-size: 0.8125rem;
line-height: 1.25;
font-family: inherit;
}

.btn:hover:not(.btn-delete) {
background-color: #f3f4f6;
}

.actions {
display: flex;
gap: 1rem;
align-items: center;
flex-wrap: wrap;
gap: 0.375rem;
}

.btn {
.actions > .btn,
.actions :deep(.btn) {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
justify-content: center;
gap: 0.375rem;
margin: 0;
padding: 0.45rem 0.75rem;
border-radius: 0.375rem;
border: 1px solid #d1d5db;
background-color: #ffffff;
cursor: pointer;
color: #1f2937;
font-weight: 500;
font-size: 0.8125rem;
line-height: 1.25;
font-family: inherit;
}

.btn-icon {
flex-shrink: 0;
}

.btn:hover {
.actions > .btn:hover,
.actions :deep(.btn:hover) {
background-color: #f3f4f6;
}

Expand Down
17 changes: 2 additions & 15 deletions src/components/addressBook/ExportButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,12 @@ const exportToCSV = () => {
</script>

<style scoped>
/* Visual styles come from parent AddressBookPage `.actions :deep(.btn)` */
.btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
border-radius: 0.375rem;
border: 1px solid #d1d5db;
background-color: #ffffff;
cursor: pointer;
margin-left: 1rem;
color: #1f2937;
font-weight: 500;
margin: 0;
}

.btn-icon {
flex-shrink: 0;
}

.btn:hover {
background-color: #f3f4f6;
}
</style>
17 changes: 2 additions & 15 deletions src/components/addressBook/ImportButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,12 @@ const handleConfirmImport = (contacts: any[]) => {
</script>

<style scoped>
/* Visual styles come from parent AddressBookPage `.actions :deep(.btn)` */
.btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
border-radius: 0.375rem;
border: 1px solid #d1d5db;
background-color: #ffffff;
cursor: pointer;
margin-left: 1rem;
color: #1f2937;
font-weight: 500;
margin: 0;
}

.btn-icon {
flex-shrink: 0;
}

.btn:hover {
background-color: #f3f4f6;
}
</style>
Loading
Loading