Skip to content

Commit

Permalink
Merge pull request #178 from HackMelbourne/navbar-update
Browse files Browse the repository at this point in the history
Navbar update
  • Loading branch information
e3lo authored Jun 16, 2024
2 parents fcb1ed2 + 0423619 commit 288ee7c
Show file tree
Hide file tree
Showing 7 changed files with 266 additions and 41 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-ga4": "^2.1.0",
"react-icons": "^4.8.0",
"react-icons": "^5.2.1",
"react-markdown": "^9.0.1",
"react-router-dom": "^6.9.0",
"styled-components": "^5.3.9",
Expand Down
Binary file added public/img/temp-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/features/Navbar/NavbarPill.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Link } from "react-router-dom";
import { NavbarPillProps } from "./NavbarPillProps";

const NavbarPill = ({ title, desc, Icon, image, link } : NavbarPillProps) => {
return (
<Link to={link}>
<div className="relative w-full flex gap-4 items-center justify-center px-3 py-4 mt-2 rounded-md border border-white bg-center bg-cover"
style={{ backgroundImage: `url(${image})` }}>
<div className="absolute inset-0 bg-black opacity-50 z-0"></div>
<Icon className="relative w-8 h-8 z-10" />
<div className="relative flex flex-col gap-1 z-10">
<h3 className="font-semibold text-md">{title}</h3>
<p className="text-sm">{desc}</p>
</div>
</div>
</Link>
)
}

export default NavbarPill;
10 changes: 10 additions & 0 deletions src/features/Navbar/NavbarPillProps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { IconType } from "react-icons";

export interface NavbarPillProps {
title: string;
desc: string;
Icon: IconType;
image: string;
link: string;
}

62 changes: 58 additions & 4 deletions src/layouts/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import React, { useEffect, useState } from "react";
import { Outlet, useLocation } from "react-router";
import { FaDiscord, FaEnvelope, FaFacebook, FaInstagram, FaLinkedin, FaTiktok } from "react-icons/fa";
import {
FaDiscord,
FaEnvelope,
FaFacebook,
FaInstagram,
FaLinkedin,
FaTiktok,
FaCalendar,
FaLink,
FaFlag,
FaPersonBooth,
FaUser,
} from "react-icons/fa";
import {
DISCORD_LINK,
FACEBOOK_LINK,
Expand All @@ -14,6 +26,7 @@ import {

// Components
import Navbar from "./Navbar";
import { NavbarPillProps } from "../features/Navbar/NavbarPillProps";
import Footer from "./Footer";

// Styles
Expand All @@ -40,11 +53,50 @@ const Layout = () => {
setIsShowFooter(!isFooterHidden);
}, [location]);

const homePills: NavbarPillProps[] = [];

const aboutPills: NavbarPillProps[] = [
{
title: "Events",
desc: "Our flagship Events!",
Icon: FaFlag,
image: "/img/temp-bg.jpg",
link: "/about/events",
},
{
title: "Meet the team",
desc: "See our amazing team",
Icon: FaUser,
image: "/img/temp-bg.jpg",
link: "/about/meettheteam",
},
];

const calenderPills: NavbarPillProps[] = [
{
title: "Calender",
desc: "See what's going on!",
Icon: FaCalendar,
image: "/img/temp-bg.jpg",
link: "/upcoming/calendar",
},
{
title: "Links",
desc: "Signups, events and more",
Icon: FaLink,
image: "/img/temp-bg.jpg",
link: "/upcoming/links",
},
];

const sponsorPills: NavbarPillProps[] = [];

const nav = {
clubname: "HackMelbourne",
logo: "/img/HM_White_Transparent.png",
pages: ["Home", "Meet The Team", "Calendar", "Sponsors"],
links: ["/", "about/meettheteam", "upcoming/calendar", "sponsors"],
pages: ["Home", "About", "Upcoming", "Sponsors"],
links: ["/", "/about/meettheteam", "/upcoming/calendar", "/sponsors"],
pills: [homePills, aboutPills, calenderPills, sponsorPills],
};

const footer = {
Expand Down Expand Up @@ -89,7 +141,9 @@ const Layout = () => {
return (
<>
<div className="w-screen max-w-full overflow-x-clip">
{isShowNavbar ? <Navbar clubname={nav.clubname} logo={nav.logo} pages={nav.pages} links={nav.links} /> : null}
{isShowNavbar ? (
<Navbar clubname={nav.clubname} logo={nav.logo} pages={nav.pages} links={nav.links} pills={nav.pills} />
) : null}
<Outlet />
{isShowFooter ? <Footer links={footer.links} icons={footer.icons} /> : null}

Expand Down
Loading

0 comments on commit 288ee7c

Please sign in to comment.