Skip to content

Commit

Permalink
Add first year fb group to navbar, remove calendar from navbar (dead …
Browse files Browse the repository at this point in the history
…link), refactor navbar using .map
  • Loading branch information
scorpiontornado committed Jan 17, 2024
1 parent 635c41e commit 9818e7e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 51 deletions.
72 changes: 21 additions & 51 deletions components/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ import Headroom from "headroom.js";
// reactstrap components
import {
Collapse,
UncontrolledDropdown,
Navbar,
NavItem,
Nav,
Container,
Row,
Col,
DropdownMenu,
DropdownItem,
DropdownToggle,
NavbarToggler,
} from "reactstrap";

Expand All @@ -48,6 +44,18 @@ import NextNavbarBrand from "./link/NextNavbarBrand.jsx";
import NextNavLink from "./link/NextNavLink.jsx";
import NavIcon from "./navigation/NavIcon.jsx";

// Supports both internal and external links, but internal links/redirects are preferred
const navLinks = [
// [text, link]
["About Us", "/about"],
["Team", "/team"],
["Events", "/events"],
["Publications", "/publications"],
["Charity", "/charity"],
// ["Calendar", "/calendar"], // TODO add 2024 calendar
["First Year FB Group", "/first-year-fb-group"],
];

const Navigation = () => {
const router = useRouter();
const [open, setOpen] = useState(false);
Expand Down Expand Up @@ -102,53 +110,15 @@ const Navigation = () => {
</Row>
</div>
<Nav className="navbar-nav-click align-items-lg-center" navbar>
<NavItem>
<Link href="/about" passHref>
<NextNavLink className={getNavLinkClass("/about")}>
<span className="nav-link-inner--text">About Us</span>
</NextNavLink>
</Link>
</NavItem>

<NavItem>
<Link href="/team" passHref>
<NextNavLink className={getNavLinkClass("/team")}>
<span className="nav-link-inner--text">The Team</span>
</NextNavLink>
</Link>
</NavItem>

<NavItem>
<Link href="/events" passHref>
<NextNavLink className={getNavLinkClass("/events")}>
<span className="nav-link-inner--text">Events</span>
</NextNavLink>
</Link>
</NavItem>

<NavItem>
<Link href="/publications" passHref>
<NextNavLink className={getNavLinkClass("/publications")}>
<span className="nav-link-inner--text">Publications</span>
</NextNavLink>
</Link>
</NavItem>

<NavItem>
<Link href="/charity" passHref>
<NextNavLink className={getNavLinkClass("/charity")}>
<span className="nav-link-inner--text">Charity</span>
</NextNavLink>
</Link>
</NavItem>

<NavItem>
<Link href="/calendar" passHref>
<NextNavLink className={getNavLinkClass("/calendar")}>
<span className="nav-link-inner--text">Calendar</span>
</NextNavLink>
</Link>
</NavItem>
{navLinks.map(([text, link]) => (
<NavItem>
<Link href={link} passHref>
<NextNavLink className={getNavLinkClass(link)}>
<span className="nav-link-inner--text">{text}</span>
</NextNavLink>
</Link>
</NavItem>
))}
</Nav>

<Nav className="align-items-lg-center ml-lg-auto" navbar>
Expand Down
12 changes: 12 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ const nextConfig = {
sassOptions: {
includePaths: [path.join(__dirname, "styles")],
},
redirects: async () => [
// {
// source: "/calendar",
// destination: "", // TODO
// permanent: false,
// },
{
source: "/first-year-fb-group",
destination: "https://www.facebook.com/groups/883034036564419/",
permanent: false,
},
]
};

module.exports = nextConfig;

0 comments on commit 9818e7e

Please sign in to comment.