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

fix: mobile menu #340

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
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: 5 additions & 5 deletions blitz-app/public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
https://ladderly.io/blog
</loc>
</url>
<url>
<loc>
https://ladderly.io/blog/2023-07-21-community-bounty
</loc>
</url>
<url>
<loc>
https://ladderly.io/blog/2023-10-01-quality-course-and-projects
Expand Down Expand Up @@ -179,6 +174,11 @@
https://ladderly.io/signup
</loc>
</url>
<url>
<loc>
https://ladderly.io/success
</loc>
</url>
<url>
<loc>
https://ladderly.io/top-honors
Expand Down
163 changes: 83 additions & 80 deletions blitz-app/src/app/mobile-menu/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
MENU_ITEM_STANDARD_CLASSES,
TOP_NAV_STANDARD_CLASSES,
} from 'src/core/components/page-wrapper/TopNavSubmenu'
import { ThemeProvider } from 'src/core/theme/ThemeContext'

const MOBILE_LINK_CLASSES =
'block rounded-lg bg-white p-4 py-2 text-lg text-gray-700 shadow hover:text-gray-900'
Expand Down Expand Up @@ -102,86 +103,88 @@ const MobileMenuPage = () => {
}

return (
<div className="fixed inset-0 flex flex-col bg-ladderly-light-purple-1">
<TopNavFlexContainer>
<TopNavLeft />
<button
onClick={handleClose}
className={`${TOP_NAV_STANDARD_CLASSES} ml-auto`}
>
Close
</button>
</TopNavFlexContainer>

<nav className="mt-25% grow overflow-y-auto px-4">
<ul className="grid grid-cols-2 gap-4">
<Suspense fallback={<p>Loading...</p>}>
<AuthenticatedPartialMenu />
</Suspense>

<li>
<Link href="/about" className={MOBILE_LINK_CLASSES}>
About
</Link>
</li>
<li>
<Link href="/blog" className={MOBILE_LINK_CLASSES}>
Blog
</Link>
</li>
<li>
<button
onClick={toggleCommunitySubmenu}
className={`${MOBILE_LINK_CLASSES} flex items-center justify-between ${
isCommunitySubmenuOpen
? 'border border-gray-200 bg-gray-100'
: ''
}`}
>
Community
<IconVerticalChevron isPointingUp={isCommunitySubmenuOpen} />
</button>
{isCommunitySubmenuOpen && (
<ul>
<CommunityMenuItems
linkClassName={MOBILE_SUBMENU_ITEM_CLASSES}
/>
</ul>
)}
</li>
<li>
<button
onClick={toggleTopHonorsSubmenu}
className={`${MOBILE_LINK_CLASSES} flex items-center justify-between ${
isTopHonorsSubmenuOpen
? 'border border-gray-200 bg-gray-100'
: ''
}`}
>
Top Honors
<IconVerticalChevron isPointingUp={isTopHonorsSubmenuOpen} />
</button>
{isTopHonorsSubmenuOpen && (
<ul>
<li>
<Link href="/vote" className={MOBILE_SUBMENU_ITEM_CLASSES}>
Vote
</Link>
</li>
<li>
<Link
href="/top-honors"
className={MOBILE_SUBMENU_ITEM_CLASSES}
>
View Top Honors
</Link>
</li>
</ul>
)}
</li>
</ul>
</nav>
</div>
<ThemeProvider>
<div className="fixed inset-0 flex flex-col bg-ladderly-light-purple-1">
<TopNavFlexContainer>
<TopNavLeft />
<button
onClick={handleClose}
className={`${TOP_NAV_STANDARD_CLASSES} ml-auto`}
>
Close
</button>
</TopNavFlexContainer>

<nav className="mt-25% grow overflow-y-auto px-4">
<ul className="grid grid-cols-2 gap-4">
<Suspense fallback={<p>Loading...</p>}>
<AuthenticatedPartialMenu />
</Suspense>

<li>
<Link href="/about" className={MOBILE_LINK_CLASSES}>
About
</Link>
</li>
<li>
<Link href="/blog" className={MOBILE_LINK_CLASSES}>
Blog
</Link>
</li>
<li>
<button
onClick={toggleCommunitySubmenu}
className={`${MOBILE_LINK_CLASSES} flex items-center justify-between ${
isCommunitySubmenuOpen
? 'border border-gray-200 bg-gray-100'
: ''
}`}
>
Community
<IconVerticalChevron isPointingUp={isCommunitySubmenuOpen} />
</button>
{isCommunitySubmenuOpen && (
<ul>
<CommunityMenuItems
linkClassName={MOBILE_SUBMENU_ITEM_CLASSES}
/>
</ul>
)}
</li>
<li>
<button
onClick={toggleTopHonorsSubmenu}
className={`${MOBILE_LINK_CLASSES} flex items-center justify-between ${
isTopHonorsSubmenuOpen
? 'border border-gray-200 bg-gray-100'
: ''
}`}
>
Top Honors
<IconVerticalChevron isPointingUp={isTopHonorsSubmenuOpen} />
</button>
{isTopHonorsSubmenuOpen && (
<ul>
<li>
<Link href="/vote" className={MOBILE_SUBMENU_ITEM_CLASSES}>
Vote
</Link>
</li>
<li>
<Link
href="/top-honors"
className={MOBILE_SUBMENU_ITEM_CLASSES}
>
View Top Honors
</Link>
</li>
</ul>
)}
</li>
</ul>
</nav>
</div>
</ThemeProvider>
)
}

Expand Down