fix: fixed user navbar ui Implements #1444#1446
Conversation
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant NavUserComponent
User->>NavUserComponent: Render expanded NavUser
NavUserComponent->>NavUserComponent: Show user name
alt User is pro
NavUserComponent->>NavUserComponent: Show BadgeCheck icon next to name
else User is not pro
NavUserComponent->>NavUserComponent: Show "Get verified" button below email
end
NavUserComponent->>NavUserComponent: Show truncated email below name and badge/button
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/mail/components/ui/nav-user.tsx(1 hunks)
🔇 Additional comments (4)
apps/mail/components/ui/nav-user.tsx (4)
581-581: LGTM: Container styling updateThe addition of
mt-2class provides appropriate spacing for the reorganized layout.
584-584: LGTM: Consistent username widthRemoving the conditional max-width logic simplifies the code and ensures consistent text truncation regardless of pro status.
589-590: LGTM: Simplified conditional renderingThe change to render only the BadgeCheck icon for pro users and null for non-pro users is cleaner and aligns with the new layout structure.
591-593: LGTM: Email always displayedMoving the email to always be displayed provides consistent user information visibility.
| <div className="flex items-center justify-between gap-2 mt-2"> | ||
| <div className="mt-[2px] flex flex-col items-start gap-1 space-y-1"> | ||
| <div className="flex items-center gap-1 text-[13px] leading-none text-black dark:text-white"> | ||
| <p className={cn('truncate text-[13px]', isPro ? 'max-w-[14.5ch]' : 'max-w-[8.5ch]')}> |
There was a problem hiding this comment.
We still need to account for the user if pro or not
There was a problem hiding this comment.
The maximum width of the username remains the same for all users, ensuring that the full name is always visible on the screen, as it's usually not very long (if it is long some of it will be visible). The check for a Pro user is handled in the next line, where a badge is displayed next to their name. If the user is Pro, the "Get Verified" button is hidden.
I’ve updated the layout by moving the "Get Verified" button below the username instead of placing it beside it. This makes the top section of the user navbar look cleaner and prevents overflow issues when zooming in or out.

Summary by CodeRabbit