feat: add user authentication UI to header component
Add login and register dialogs, user dropdown menu with profile link and logout option, and integrate with session management hook. Prevent hydration mismatches by conditionally rendering auth elements after mount. Update package-lock.json with new @esbuild dependencies for build tooling.
This commit is contained in:
1 parent
e641138887
commit
55eebde0ba
55 files changed
+7353
-7
No files matched your search
@@ -0,0 +1,23 @@
|
||||
-- Migration 010: Tabela de notificações
|
||||
-- Criado em: 2025-01-27
|
||||
|
||||
-- Tabela de notificações
|
||||
CREATE TABLE IF NOT EXISTS notifications (
|
||||
notification_id SERIAL PRIMARY KEY,
|
||||
user_id INTEGER NOT NULL REFERENCES users(user_id) ON DELETE CASCADE,
|
||||
notification_type VARCHAR(30) CHECK (notification_type IN ('bid', 'sale', 'purchase', 'escrow', 'dispute', 'system')),
|
||||
title VARCHAR(255) NOT NULL,
|
||||
message TEXT NOT NULL,
|
||||
related_id INTEGER, -- ID da transação/listing relacionado
|
||||
is_read BOOLEAN DEFAULT FALSE,
|
||||
send_whatsapp BOOLEAN DEFAULT FALSE,
|
||||
whatsapp_sent BOOLEAN DEFAULT FALSE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Índices para performance
|
||||
CREATE INDEX IF NOT EXISTS idx_notifications_user ON notifications(user_id, is_read);
|
||||
CREATE INDEX IF NOT EXISTS idx_notifications_type ON notifications(notification_type);
|
||||
CREATE INDEX IF NOT EXISTS idx_notifications_created_at ON notifications(created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_notifications_unread ON notifications(user_id, is_read) WHERE is_read = FALSE;
|
||||
|
||||
Reference in new issue
Block a user