Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Giving day] fixed navbar selected item underline bug #868

Merged
merged 2 commits into from
Mar 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions new-dti-website/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ const Navbar: React.FC = () => {
key={item.name}
href={item.url}
className={`group cursor-pointer p-4 underline-offset-8 decoration-2 h-[40px] flex items-center ${
pathname === item.url ? 'underline' : ''
} ${
item.name === 'Sponsor'
? 'mr-2 rounded-[128px] [transition:50ms_ease-out] border border-[rgba(227,73,73,0.60)] px-4 py-2 hover:bg-[rgba(229,74,74,0.20)]'
: ''
Expand All @@ -78,7 +76,8 @@ const Navbar: React.FC = () => {
? 'bg-gradient-to-r from-[#F25454] to-[#D63D3D] bg-clip-text text-transparent'
: 'text-white'
}
${item.name === 'Apply' ? '!text-[#000000]' : ''}
${pathname === item.url ? 'underline' : ''}
${item.name === 'Apply' ? '!text-[#000000] no-underline' : ''}
${item.name !== 'Apply' ? 'group-hover:underline' : ''}
`}
>
Expand Down Expand Up @@ -123,8 +122,6 @@ const Navbar: React.FC = () => {
key={item.name}
href={item.url}
className={`group cursor-pointer p-4 underline-offset-8 decoration-2 h-[40px] flex items-center ${
pathname === item.url ? 'underline' : ''
} ${
item.name === 'Sponsor'
? 'mr-2 rounded-[128px] [transition:50ms_ease-out] border border-[rgba(227,73,73,0.60)] px-4 py-2 hover:bg-[rgba(229,74,74,0.20)] justify-center h-[52px]'
: ''
Expand All @@ -141,7 +138,8 @@ const Navbar: React.FC = () => {
? 'bg-gradient-to-r from-[#F25454] to-[#D63D3D] bg-clip-text text-transparent'
: 'text-white'
}
${item.name === 'Apply' ? '!text-[#000000]' : ''}
${pathname === item.url ? 'underline' : ''}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to add it on the <span> so it applies to the text label instead of on the parent <a>

${item.name === 'Apply' ? '!text-[#000000] no-underline' : ''}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

override underline on buttons (we shouldn't show an underline)

${item.name !== 'Apply' ? 'group-hover:underline' : ''}
`}
>
Expand Down
Loading