Merge pull request #35 from rede5/codex/add-user-and-company-profile-dropdown

Header: add notification bell, move cart left and profile/company links; add anchors in Profile page
This commit is contained in:
Tiago Yamamoto 2025-12-22 17:39:55 -03:00 committed by GitHub
commit 64f72db26f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 6 deletions

View file

@ -16,6 +16,8 @@ import {
MinusIcon,
UserIcon,
ArrowRightOnRectangleIcon,
BuildingOffice2Icon,
BellIcon,
} from "@heroicons/react/24/outline";
interface HeaderProps {
@ -142,6 +144,9 @@ const Header = ({
{subtitle}
</p>
</div>
<div className="ml-2 sm:ml-4 flex items-center">
<CarrinhoCompras />
</div>
</div>
{/* Informações do usuário */}
@ -149,8 +154,13 @@ const Header = ({
{/* Menu Loja Virtual */}
<LojaVirtualMenu />
{/* Carrinho de Compras */}
<CarrinhoCompras />
<button
type="button"
className="relative rounded-full p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-50 transition-colors"
aria-label="Notificações"
>
<BellIcon className="w-5 h-5 sm:w-6 sm:h-6" />
</button>
{/* Indicador de cadastro incompleto */}
{!loading && !isCompleto && (
@ -195,11 +205,20 @@ const Header = ({
<ul className="absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg z-10 border">
<li>
<Link
href="/perfil"
href="/perfil#usuario"
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-t-lg flex items-center"
>
<UserIcon className="w-4 h-4 mr-2 flex-shrink-0" />
Ver Perfil
Perfil do usuário
</Link>
</li>
<li>
<Link
href="/perfil#empresa"
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center"
>
<BuildingOffice2Icon className="w-4 h-4 mr-2 flex-shrink-0" />
Perfil da empresa
</Link>
</li>
<li>

View file

@ -127,7 +127,7 @@ export default function ProfileForm({ usuarioData }: { usuarioData?: UserData |
}
return (
<div className="max-w-4xl mx-auto p-6 space-y-6">
<div id="usuario" className="max-w-4xl mx-auto p-6 space-y-6">
{/* Header do Perfil */}
<div className="bg-white rounded-lg shadow-md p-6">
<div className="flex items-center space-x-4">
@ -258,7 +258,7 @@ export default function ProfileForm({ usuarioData }: { usuarioData?: UserData |
{/* Empresas Detalhadas */}
{empresasDetalhadas.length > 0 && (
<div className="bg-white rounded-lg shadow-md p-6">
<div id="empresa" className="bg-white rounded-lg shadow-md p-6">
<h3 className="text-xl font-semibold text-gray-900 mb-4 flex items-center">
<Building className="w-5 h-5 mr-2" />
Empresas Vinculadas