-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(layout): improve visibility on mobile devices
- Loading branch information
Showing
14 changed files
with
405 additions
and
27 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,13 @@ | ||
import NavDesktopButton from './NavDesktopButton' | ||
|
||
const NavDesktop = () => { | ||
return ( | ||
<div className="hidden md:flex flex-1 justify-end mr-6"> | ||
<NavDesktopButton label="home" linkTo="/" /> | ||
<NavDesktopButton label="faq" linkTo="/faq" /> | ||
<NavDesktopButton label="about" linkTo="/about" /> | ||
</div> | ||
) | ||
} | ||
|
||
export default NavDesktop |
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,27 @@ | ||
import { useRef, useState } from 'react' | ||
import { Squash as Hamburger } from 'hamburger-react' | ||
import { FaLightbulb, FaQuestion } from 'react-icons/fa6' | ||
import { FaHome } from 'react-icons/fa' | ||
import { useClickAway } from 'react-use' | ||
import NavMobileButton from './NavMobileButton' | ||
|
||
const NavMobile = () => { | ||
const [isOpen, setOpen] = useState(false) | ||
const ref = useRef(null) | ||
useClickAway(ref, () => setOpen(false)) | ||
|
||
return ( | ||
<div ref={ref} className="md:hidden flex-1 justify-end mr-6 text-white"> | ||
<Hamburger toggled={isOpen} size={20} toggle={setOpen} /> | ||
{isOpen && ( | ||
<div className="fixed left-0 shadow-4xl right-0 top-[3.5rem] p-5 pt-0 bg-neutral-950 border-b border-b-white/20 z-10"> | ||
<NavMobileButton label="home" linkTo="/" icon={<FaHome />} setOpen={setOpen} /> | ||
<NavMobileButton label="faq" linkTo="/faq" icon={<FaQuestion />} setOpen={setOpen} /> | ||
<NavMobileButton label="about" linkTo="/about" icon={<FaLightbulb />} setOpen={setOpen} /> | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default NavMobile |
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,27 @@ | ||
import React, { Dispatch, ReactElement, SetStateAction } from 'react' | ||
import useLanguage from '../../hooks/useLanguage' | ||
|
||
type NavMobileButtonProps = { | ||
label: string | ||
linkTo: string | ||
icon: ReactElement | ||
setOpen: Dispatch<SetStateAction<boolean>> | ||
} | ||
|
||
const NavMobileButton: React.FC<NavMobileButtonProps> = ({ label, linkTo, icon, setOpen }) => { | ||
const { getMessage } = useLanguage() | ||
return ( | ||
<div className="w-full p-[0.08rem] rounded-xl bg-gradient-to-tr from-neutral-800 via-neutral-950 to-neutral-700"> | ||
<a | ||
onClick={() => setOpen((prev) => !prev)} | ||
className={'flex items-center justify-between w-full p-5 rounded-xl bg-neutral-950'} | ||
href={linkTo} | ||
> | ||
<span className="flex gap-1 text-lg">{getMessage(label)}</span> | ||
{icon} | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
||
export default NavMobileButton |
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
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 |
---|---|---|
|
@@ -200,6 +200,7 @@ const AboutScreen = () => { | |
<ErtIcon /> | ||
</a> | ||
</p> | ||
<p className="mt-10"> </p> | ||
</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