Merge branch 'main' into feat/organized-content

This commit is contained in:
William Tran 2021-05-30 17:23:01 -04:00
commit d7257c7223
4 changed files with 44 additions and 12 deletions

View File

@ -50,14 +50,44 @@ const menu: NavLink[] = [
}, },
{ {
name: "Resources", name: "Resources",
route: "/resources", route: "/resources/services",
submenu: [
{
name: "Services",
route: "/resources/services",
},
{
name: "Tech Talks",
route: "/resources/tech-talks",
},
{
name: "CS Club Wiki",
route: "https://wiki.csclub.uwaterloo.ca/",
},
],
}, },
]; ];
function NavItem(props: NavLink) { function NavItem(props: NavLink) {
const router = useRouter(); const router = useRouter();
const externalLink =
props.route.includes("http://") || props.route.includes("https://");
return ( return (
<> <>
{externalLink ? (
<a
href={props.route}
target="_blank"
rel="noopener noreferrer"
onClick={() => {
if (document.activeElement instanceof HTMLElement) {
document.activeElement.blur();
}
}}
>
{props.name}
</a>
) : (
<Link href={props.route}> <Link href={props.route}>
<a <a
title={props.name} title={props.name}
@ -77,6 +107,7 @@ function NavItem(props: NavLink) {
{props.name} {props.name}
</a> </a>
</Link> </Link>
)}
{(props.submenu?.length ?? 0) > 0 ? ( {(props.submenu?.length ?? 0) > 0 ? (
<ul className={styles.dropdown}> <ul className={styles.dropdown}>
{props.submenu?.map((item) => { {props.submenu?.map((item) => {

View File

@ -1 +0,0 @@
# Resources page

View File

@ -0,0 +1 @@
# Services Page

View File

@ -0,0 +1 @@
# Tech Talks Page