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

style: make mobile navbar transparent #1934 #1935

Merged
merged 1 commit into from
Aug 2, 2023
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
74 changes: 37 additions & 37 deletions components/MobileNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,47 @@ import { FaGithub } from 'react-icons/fa'
import Link from 'next/link'

interface NavbarItem {
icon: React.ReactElement;
text: string;
url: string;
}
icon: React.ReactElement;
text: string;
url: string;
}

const navbarItemsData: NavbarItem[] = [
{
icon: <AiFillHome />,
text: "Home",
url: "/",
},
{
icon: <MdExplore />,
text: "Projects",
url: "/projects",
},
{
icon: <BiSolidBookBookmark />,
text: "Docs",
url: "/docs",
},
{
icon: <FaGithub />,
text: "GitHub",
url: "https://github.com/priyankarpal/ProjectsHut",
},
{
icon: <AiFillHome />,
text: "Home",
url: "/",
},
{
icon: <MdExplore />,
text: "Projects",
url: "/projects",
},
{
icon: <BiSolidBookBookmark />,
text: "Docs",
url: "/docs",
},
{
icon: <FaGithub />,
text: "GitHub",
url: "https://github.com/priyankarpal/ProjectsHut",
},
];

export const MobileNavBar = () => {
return (
<footer className="fixed bottom-4 w-1/11 left-0 right-0 bg-gray-800 text-white py-4 md:hidden rounded-xl mx-5">
<div className="mx-auto text-xl flex justify-evenly items-center px-4">
{navbarItemsData.map((link, idx) => (
<Link href={link.url} key={idx}>
<div className="flex flex-col items-center cursor-pointer transition-all hover:text-primary">
{link.icon}
<div className="text-sm">{link.text}</div>
</div>
</Link>
))}
return (
<footer className="fixed bottom-4 w-1/11 left-0 right-0 bg-transparent backdrop-blur-md border-gray-700 border text-white py-4 md:hidden rounded-xl mx-5">
<div className="mx-auto text-xl flex justify-evenly items-center px-4">
{navbarItemsData.map((link, idx) => (
<Link href={link.url} key={idx}>
<div className="flex flex-col items-center cursor-pointer transition-all hover:text-primary">
{link.icon}
<div className="text-sm">{link.text}</div>
</div>
</footer>
)
</Link>
))}
</div>
</footer>
)
}
6 changes: 3 additions & 3 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ const Navbar: NextPage = () => {
rel="noopener noreferrer"
className={
activePath === navLink.path ||
activePath === navLink.path + "/"
activePath === navLink.path + "/"
? "inline-block py-2 px-3 text-center text-primary hover:text-primary rounded-lg"
: "inline-block py-2 px-3 text-center text-white hover:text-primary rounded-lg"
}
>
{navLink.name}
{navLink.name}
</a>
) : (
<Link
href={navLink.path}
className={
activePath === navLink.path ||
activePath === navLink.path + "/"
activePath === navLink.path + "/"
? "inline-block py-2 px-3 text-center text-primary hover:text-primary rounded-lg"
: "inline-block py-2 px-3 text-center text-white hover:text-primary rounded-lg"
}
Expand Down