From 73ff4691266bc8e5cb43272cbaf78c00e236236f Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Fri, 1 May 2026 09:08:43 +0700 Subject: [PATCH] feat(web): convert navbar profile pill into a dropdown menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The profile pill in the top nav was a static `
` showing the avatar + name + role with no way to reach the dashboard, profile or logout from the desktop layout — testers reported "không có dropdown dashboard" after login. Changes to `components/design-system/navbar.tsx`: * The pill is now a ` + + {userMenuOpen && ( +
+ {/* Header */} +
+ {user.avatarUrl ? ( + // eslint-disable-next-line @next/next/no-img-element + + ) : ( +
+ {getInitials(user.fullName)} +
+ )} +
+ + {user.fullName} + + {(user.email || user.phone) && ( + + {user.email ?? user.phone} + + )} +
+
+ +
+ {renderLink({ + href: dashboardHref, + onClick: () => setUserMenuOpen(false), + children: ( + + {user.role === 'ADMIN' ? ( + + ) : ( + + )} + {user.role === 'ADMIN' ? labels.admin : labels.dashboard} + + ), + })} + {renderLink({ + href: profileHref, + onClick: () => setUserMenuOpen(false), + children: ( + + + {labels.profile} + + ), + })} +
+ +
)} - - {user.fullName} - - {ROLE_LABELS[user.role] && ( - - {ROLE_LABELS[user.role]} - - )}
- - {renderLink({ - href: dashboardHref, - className: 'hidden sm:inline-flex', - children: ( - - ), - })} ) : ( <>