-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added mobile responsivity for tab bar along with light/dark mode support
- Loading branch information
1 parent
c2ac35f
commit 62393c3
Showing
5 changed files
with
166 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -0,0 +1,131 @@ | ||
import { useRouter } from 'next/router' | ||
import Link from 'next/link' | ||
import { useState, useEffect } from 'react' | ||
|
||
export function TabLinks({ isHomePage }) { | ||
const router = useRouter() | ||
const [isLargeScreen, setIsLargeScreen] = useState(false) | ||
|
||
useEffect(() => { | ||
const checkScreenSize = () => { | ||
setIsLargeScreen(window.innerWidth >= 1140) | ||
} | ||
|
||
// Check initial screen size | ||
checkScreenSize() | ||
|
||
window.addEventListener('resize', checkScreenSize) | ||
|
||
return () => { | ||
// Clean up event listener | ||
window.removeEventListener('resize', checkScreenSize) | ||
} | ||
}, []) | ||
|
||
return ( | ||
<div className="-ml-3 flex flex-col custom:-ml-0 custom:flex-row custom:items-center"> | ||
<Link | ||
href="/tezos-blockchain-overview/" | ||
className={`px-4 py-2 ${ | ||
!router.pathname.includes('tutorials') && | ||
!router.pathname.includes('office-hours') && | ||
!isHomePage | ||
? 'text-blue-400' | ||
: 'text-white' | ||
}`} | ||
> | ||
{isLargeScreen ? ( | ||
<div className="hover:text-gray-300 dark:hover:text-gray-500"> | ||
Documentation | ||
</div> | ||
) : ( | ||
<h2 | ||
className="font-display font-medium text-slate-900 hover:text-blue-400 dark:text-white" | ||
style={{ fontSize: '1.3em' }} | ||
> | ||
Documentation | ||
</h2> | ||
)} | ||
</Link> | ||
<Link | ||
href="/tutorials" | ||
className={`px-4 py-2 ${ | ||
router.pathname.includes('/tutorials') | ||
? 'text-blue-400' | ||
: 'text-white' | ||
}`} | ||
> | ||
{isLargeScreen ? ( | ||
<div className="hover:text-gray-300 dark:hover:text-gray-500"> | ||
Tutorials | ||
</div> | ||
) : ( | ||
<h2 | ||
className="font-display font-medium text-slate-900 hover:text-blue-400 dark:text-white" | ||
style={{ fontSize: '1.3em' }} | ||
> | ||
Tutorials | ||
</h2> | ||
)} | ||
</Link> | ||
<Link | ||
href="/office-hours" | ||
className={`px-4 py-2 ${ | ||
router.pathname.endsWith('office-hours') | ||
? 'text-blue-400' | ||
: 'text-white' | ||
}`} | ||
> | ||
{isLargeScreen ? ( | ||
<div className="hover:text-gray-300 dark:hover:text-gray-500"> | ||
Office Hours | ||
</div> | ||
) : ( | ||
<h2 | ||
className="font-display font-medium text-slate-900 hover:text-blue-400 dark:text-white" | ||
style={{ fontSize: '1.3em' }} | ||
> | ||
Office Hours | ||
</h2> | ||
)} | ||
</Link> | ||
</div> | ||
) | ||
|
||
// return ( | ||
// <div className="ml-6 flex flex-col custom:flex-row"> | ||
// <Link | ||
// href="/tezos-blockchain-overview/" | ||
// className={`px-4 py-2 ${ | ||
// (!router.pathname.includes('tutorials') && | ||
// !router.pathname.includes('office-hours') && | ||
// !isHomePage) | ||
// ? 'text-blue-400' | ||
// : 'text-white' | ||
// } hover:text-gray-300 dark:hover:text-gray-500`} | ||
// > | ||
// Documentation | ||
// </Link> | ||
// <Link | ||
// href="/tutorials" | ||
// className={`px-4 py-2 ${ | ||
// router.pathname.includes('/tutorials') | ||
// ? 'text-blue-400' | ||
// : 'text-white' | ||
// } hover:text-gray-300 dark:hover:text-gray-500`} | ||
// > | ||
// Tutorials | ||
// </Link> | ||
// <Link | ||
// href="/office-hours" | ||
// className={`px-4 py-2 ${ | ||
// router.pathname.endsWith('office-hours') | ||
// ? 'text-blue-400' | ||
// : 'text-white' | ||
// } hover:text-gray-300 dark:hover:text-gray-500`} | ||
// > | ||
// Office Hours | ||
// </Link> | ||
// </div> | ||
// ); | ||
} |
This file contains 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