-
-
Notifications
You must be signed in to change notification settings - Fork 17
Adjust mobile screen #66
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
Open
sunilkumawat-96
wants to merge
1
commit into
StabilityNexus:main
Choose a base branch
from
sunilkumawat-96:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,10 @@ | |
| import Link from "next/link" | ||
| import { usePathname } from "next/navigation" | ||
| import { Button } from "@/components/ui/button" | ||
| import { Avatar, AvatarFallback } from "@/components/ui/avatar" | ||
| import { ConnectButton } from '@rainbow-me/rainbowkit' | ||
| import { useState } from "react" | ||
| import { Menu, X } from "lucide-react" | ||
|
|
||
| // Helper function to get the correct image path for GitHub Pages | ||
| const getImagePath = (path: string) => { | ||
| // For static export, we need to ensure the path works with GitHub Pages | ||
|
|
@@ -13,6 +15,7 @@ const getImagePath = (path: string) => { | |
|
|
||
| export default function Navigation() { | ||
| const pathname = usePathname() | ||
| const [isMenuOpen, setIsMenuOpen] = useState(false) | ||
|
|
||
| return ( | ||
| <header className="border-b border-amber-100/60 bg-white/95 backdrop-blur-md sticky top-0 z-50 shadow-sm"> | ||
|
|
@@ -33,15 +36,66 @@ export default function Navigation() { | |
| </span> | ||
| </Link> | ||
|
|
||
| <nav className="hidden md:flex items-center gap-1"> | ||
| <div className="flex items-center gap-3"> | ||
| <nav className="hidden md:flex items-center gap-1"> | ||
| <Link href="/explorer"> | ||
| <Button | ||
| variant="ghost" | ||
| className={`${ | ||
| pathname === "/explorer" | ||
| ? "text-amber-800 bg-amber-50 font-semibold shadow-sm" | ||
| : "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80" | ||
| } transition-all duration-200 font-medium`} | ||
| > | ||
| Explore Hackathons | ||
| </Button> | ||
| </Link> | ||
| <Link href="/createHackathon"> | ||
| <Button | ||
| variant="ghost" | ||
| className={`${ | ||
| pathname === "/myHackathons" | ||
| ? "text-amber-800 bg-amber-50 font-semibold shadow-sm" | ||
| : "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80" | ||
| } transition-all duration-200 font-medium`} | ||
| > | ||
| Organize a Hackathon | ||
| </Button> | ||
| </Link> | ||
| <Link href="/myHackathons"> | ||
| <Button | ||
| variant="ghost" | ||
| className={`${ | ||
| pathname === "/createHackathon" | ||
| ? "text-amber-800 bg-amber-50 font-semibold shadow-sm" | ||
| : "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80" | ||
| } transition-all duration-200 font-medium`} | ||
| > | ||
| My Hackathons | ||
| </Button> | ||
| </Link> | ||
|
Comment on lines
+53
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pathname conditions are swapped between links. The active state highlighting logic is incorrect:
These conditions are swapped, causing the wrong navigation item to appear active. 🐛 Proposed fix <Link href="/createHackathon">
<Button
variant="ghost"
className={`${
- pathname === "/myHackathons"
+ pathname === "/createHackathon"
? "text-amber-800 bg-amber-50 font-semibold shadow-sm"
: "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80"
} transition-all duration-200 font-medium`}
>
Organize a Hackathon
</Button>
</Link>
<Link href="/myHackathons">
<Button
variant="ghost"
className={`${
- pathname === "/createHackathon"
+ pathname === "/myHackathons"
? "text-amber-800 bg-amber-50 font-semibold shadow-sm"
: "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80"
} transition-all duration-200 font-medium`}
>
My Hackathons
</Button>
</Link>🤖 Prompt for AI Agents |
||
| </nav> | ||
| <ConnectButton /> | ||
| <div className="md:hidden"> | ||
| <Button variant="ghost" onClick={() => setIsMenuOpen(!isMenuOpen)}> | ||
| {isMenuOpen ? <X /> : <Menu />} | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {isMenuOpen && ( | ||
| <div className="md:hidden bg-white/95 pb-4"> | ||
| <nav className="flex flex-col items-center gap-2"> | ||
| <Link href="/explorer"> | ||
| <Button | ||
| variant="ghost" | ||
| className={`${ | ||
| pathname === "/explorer" | ||
| ? "text-amber-800 bg-amber-50 font-semibold shadow-sm" | ||
| : "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80" | ||
| ? "text-amber-800 bg-amber-50 font-semibold shadow-sm w-full" | ||
| : "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80 w-full" | ||
| } transition-all duration-200 font-medium`} | ||
| onClick={() => setIsMenuOpen(false)} | ||
| > | ||
| Explore Hackathons | ||
| </Button> | ||
|
|
@@ -51,9 +105,10 @@ export default function Navigation() { | |
| variant="ghost" | ||
| className={`${ | ||
| pathname === "/myHackathons" | ||
| ? "text-amber-800 bg-amber-50 font-semibold shadow-sm" | ||
| : "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80" | ||
| ? "text-amber-800 bg-amber-50 font-semibold shadow-sm w-full" | ||
| : "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80 w-full" | ||
| } transition-all duration-200 font-medium`} | ||
| onClick={() => setIsMenuOpen(false)} | ||
| > | ||
| Organize a Hackathon | ||
| </Button> | ||
|
|
@@ -63,20 +118,17 @@ export default function Navigation() { | |
| variant="ghost" | ||
| className={`${ | ||
| pathname === "/createHackathon" | ||
| ? "text-amber-800 bg-amber-50 font-semibold shadow-sm" | ||
| : "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80" | ||
| ? "text-amber-800 bg-amber-50 font-semibold shadow-sm w-full" | ||
| : "text-gray-700 hover:text-amber-800 hover:bg-amber-50/80 w-full" | ||
| } transition-all duration-200 font-medium`} | ||
| onClick={() => setIsMenuOpen(false)} | ||
| > | ||
| My Hackathons | ||
| </Button> | ||
| </Link> | ||
| </nav> | ||
|
|
||
| <div className="flex items-center gap-3"> | ||
| <ConnectButton /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| )} | ||
| </header> | ||
| ) | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: StabilityNexus/HackHub-WebUI
Length of output: 3168
Replace
max-w-8xlwith a valid Tailwind class.The
mx-autochange is good—it properly centers content and fixes the mobile overflow issue. However,max-w-8xlis not defined in your Tailwind config and won't be applied. Replace it withmax-w-7xl(the default maximum) or extend your Tailwind config to define a custom 8xl constraint.🤖 Prompt for AI Agents