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:
Evandro Fonseca Junior committed 2025-11-04 02:33:29 -03:00
1 parent e641138887
commit 55eebde0ba
55 files changed
+7353 -7

No files matched your search

+72
View File
@@ -329,5 +329,77 @@
"share": "Share with friends",
"back": "Back to home"
}
},
"auth": {
"login": {
"title": "Sign In",
"description": "Sign in to access your account",
"emailOrUsername": "Email or Username",
"emailOrUsernamePlaceholder": "[email protected] or username",
"password": "Password",
"passwordPlaceholder": "••••••••",
"loginButton": "Sign In",
"loggingIn": "Signing in...",
"invalidCredentials": "Invalid credentials"
},
"register": {
"title": "Create Account",
"description": "Register to start trading",
"username": "Username",
"usernamePlaceholder": "your_username",
"usernameHint": "3-50 characters, letters, numbers and _",
"email": "Email",
"emailPlaceholder": "[email protected]",
"password": "Password",
"passwordPlaceholder": "••••••••",
"passwordHint": "Min. 8 characters, 1 uppercase, 1 lowercase, 1 number",
"confirmPassword": "Confirm Password",
"confirmPasswordPlaceholder": "••••••••",
"firstName": "First Name",
"firstNamePlaceholder": "Your first name",
"lastName": "Last Name",
"lastNamePlaceholder": "Your last name",
"phone": "Phone (optional)",
"phonePlaceholder": "(11) 98888-7777",
"phoneHint": "Select country and enter phone number",
"searchCountry": "Search country...",
"servers": "Servers",
"serversDescription": "Select the servers where you play",
"selectServer": "Select Server",
"characterName": "Character Name",
"characterNamePlaceholder": "Your character name",
"characterNameHint": "Min. 3 characters",
"addServer": "Add Server",
"removeServer": "Remove",
"mainCharacter": "Main Character",
"atLeastOneServer": "Select at least one server",
"characterRequired": "Character name is required",
"submit": "Create Account",
"submitting": "Creating account...",
"success": "Account created successfully!",
"errors": {
"emailExists": "This email is already registered",
"usernameExists": "This username is already in use",
"characterExists": "This character is already registered on this server",
"serverNotFound": "Server not found or inactive",
"passwordMismatch": "Passwords do not match",
"weakPassword": "Password too weak",
"invalidEmail": "Invalid email",
"invalidPhone": "Invalid phone",
"noServers": "Select at least one server",
"characterNameRequired": "Character name is required for all selected servers"
},
"passwordStrength": {
"weak": "Weak",
"medium": "Medium",
"strong": "Strong"
},
"passwordRequirements": {
"minLength": "Minimum 8 characters",
"uppercase": "1 uppercase letter",
"lowercase": "1 lowercase letter",
"number": "1 number"
}
}
}
}
+72
View File
@@ -329,5 +329,77 @@
"share": "Compartilhe com amigos",
"back": "Voltar ao início"
}
},
"auth": {
"login": {
"title": "Entrar",
"description": "Faça login para acessar sua conta",
"emailOrUsername": "Email ou Username",
"emailOrUsernamePlaceholder": "[email protected] ou username",
"password": "Senha",
"passwordPlaceholder": "••••••••",
"loginButton": "Entrar",
"loggingIn": "Entrando...",
"invalidCredentials": "Credenciais inválidas"
},
"register": {
"title": "Criar Conta",
"description": "Registre-se para começar a negociar",
"username": "Username",
"usernamePlaceholder": "seu_username",
"usernameHint": "3-50 caracteres, letras, números e _",
"email": "Email",
"emailPlaceholder": "[email protected]",
"password": "Senha",
"passwordPlaceholder": "••••••••",
"passwordHint": "Mín. 8 caracteres, 1 maiúscula, 1 minúscula, 1 número",
"confirmPassword": "Confirmar Senha",
"confirmPasswordPlaceholder": "••••••••",
"firstName": "Nome",
"firstNamePlaceholder": "Seu nome",
"lastName": "Sobrenome",
"lastNamePlaceholder": "Seu sobrenome",
"phone": "Telefone (opcional)",
"phonePlaceholder": "(11) 98888-7777",
"phoneHint": "Selecione o país e informe o telefone",
"searchCountry": "Buscar país...",
"servers": "Servidores",
"serversDescription": "Selecione os servidores onde você joga",
"selectServer": "Selecionar Servidor",
"characterName": "Nome do Personagem",
"characterNamePlaceholder": "Nome do seu personagem",
"characterNameHint": "Mín. 3 caracteres",
"addServer": "Adicionar Servidor",
"removeServer": "Remover",
"mainCharacter": "Personagem Principal",
"atLeastOneServer": "Selecione pelo menos um servidor",
"characterRequired": "Nome do personagem é obrigatório",
"submit": "Criar Conta",
"submitting": "Criando conta...",
"success": "Conta criada com sucesso!",
"errors": {
"emailExists": "Este email já está cadastrado",
"usernameExists": "Este username já está em uso",
"characterExists": "Este personagem já está cadastrado neste servidor",
"serverNotFound": "Servidor não encontrado ou inativo",
"passwordMismatch": "As senhas não coincidem",
"weakPassword": "Senha muito fraca",
"invalidEmail": "Email inválido",
"invalidPhone": "Telefone inválido",
"noServers": "Selecione pelo menos um servidor",
"characterNameRequired": "Nome do personagem é obrigatório para todos os servidores selecionados"
},
"passwordStrength": {
"weak": "Fraca",
"medium": "Média",
"strong": "Forte"
},
"passwordRequirements": {
"minLength": "Mínimo 8 caracteres",
"uppercase": "1 letra maiúscula",
"lowercase": "1 letra minúscula",
"number": "1 número"
}
}
}
}