diff --git a/js/components/auth-modal.js b/js/components/auth-modal.js index 70ae744..b0acb39 100644 --- a/js/components/auth-modal.js +++ b/js/components/auth-modal.js @@ -32,6 +32,12 @@ class AuthModal extends HTMLElement { this.hidden = false this.render() document.body.style.overflow = 'hidden' + + // Focus on input after render + requestAnimationFrame(() => { + const input = this.querySelector('#uuid') + if (input) input.focus() + }) } hide() { diff --git a/js/components/listing-card.js b/js/components/listing-card.js index d967c14..5158afd 100644 --- a/js/components/listing-card.js +++ b/js/components/listing-card.js @@ -299,14 +299,14 @@ style.textContent = /* css */` position: absolute; top: var(--space-sm); left: var(--space-sm); - width: 28px; - height: 28px; + width: 36px; + height: 36px; display: flex; align-items: center; justify-content: center; background: var(--color-bg); border: none; - border-radius: var(--radius-sm); + border-radius: var(--radius-full); box-shadow: var(--shadow-sm); z-index: 2; color: var(--color-text-muted); diff --git a/js/components/pages/page-home.js b/js/components/pages/page-home.js index 04f0620..ad583ee 100644 --- a/js/components/pages/page-home.js +++ b/js/components/pages/page-home.js @@ -2,6 +2,7 @@ import { t, i18n } from '../../i18n.js' import { listingsService } from '../../services/listings.js' import { directus } from '../../services/directus.js' import { locationsService } from '../../services/locations.js' +import { auth } from '../../services/auth.js' import '../listing-card.js' import '../skeleton-card.js' import '../search-box.js' @@ -38,6 +39,14 @@ class PageHome extends HTMLElement { this.render() this.setupEventListeners() }) + + // Re-render listings on auth change to show owner badges + this.authUnsubscribe = auth.subscribe(() => { + const container = this.querySelector('#listings-container') + if (container) { + container.innerHTML = this.renderListings() + } + }) // Listen for URL changes (back/forward navigation) window.addEventListener('hashchange', this.handleHashChange.bind(this)) @@ -45,6 +54,7 @@ class PageHome extends HTMLElement { disconnectedCallback() { if (this.unsubscribe) this.unsubscribe() + if (this.authUnsubscribe) this.authUnsubscribe() window.removeEventListener('hashchange', this.handleHashChange.bind(this)) }