diff --git a/components/Button.tsx b/components/Button.tsx index 92d75463..daf91e8f 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -21,6 +21,7 @@ export function Button(props: Props) { ({ + ...leaf, + ancestors: [...leaf.ancestors, { name: entry.name, route: entry.route }], + })), + ]; +} + +const leaves: Leaf[] = menu.reduce(collectLeaves, [] as Leaf[]); + +function shouldHighlight( + pathname: string, + name: string, + route: string +): boolean { + const match = leaves.find((leaf) => + leaf.exact ? leaf.route === pathname : pathname.startsWith(leaf.route) + ); + return match + ? (match.name === name && match.route === route) || + match.ancestors.find( + (ancestor) => ancestor.name === name && ancestor.route === route + ) != null + : false; +} + function getMainRoute(route: string) { if (route === "/") { return "/"; diff --git a/components/ShapesBackground.tsx b/components/ShapesBackground.tsx index a34a0316..0003c73d 100644 --- a/components/ShapesBackground.tsx +++ b/components/ShapesBackground.tsx @@ -45,7 +45,11 @@ export function ShapesBackground({ getConfig }: Props) { }, [getConfig, width, height, prevWidth, prevRoute, router.asPath]); return ( -
+
{Object.entries(config).map(([type, instances]) => instances.map((attributes, idx) => ( diff --git a/content/advice/coop-advice.mdx b/content/advice/co-op-advice.mdx similarity index 99% rename from content/advice/coop-advice.mdx rename to content/advice/co-op-advice.mdx index 684a6f4a..1e65bbaa 100644 --- a/content/advice/coop-advice.mdx +++ b/content/advice/co-op-advice.mdx @@ -1,4 +1,4 @@ -## Coop Advice +## Co-op Advice Although WaterlooWorks is quite reliable, there are many more opportunities outside of the job board. Being able to apply for jobs externally not only prepares you to look for jobs full time but it also diff --git a/content/get-involved.mdx b/content/get-involved.mdx index 5ef48195..b66b86c6 100644 --- a/content/get-involved.mdx +++ b/content/get-involved.mdx @@ -13,7 +13,7 @@ a bunch of ways you can join and help out. 1. Drop by our office in **MC 3036/3037** with - your WatCard, and - - $2 for term that you would like to pay for + - $2 membership fee for the term that you would like to pay for 2. Sign our [Machine Usage Agreement](/resources/machine-usage-agreement) That's all! After your account created, you'll have access to all the @@ -22,7 +22,17 @@ That's all! After your account created, you'll have access to all the #### Membership Renewal If you are already a member of the CSC and want to renew your membership, you -can do so by coming in person to our office. +can do so by coming in person to our office. You may also renew your membership +online, though you must pay more than the usual $2.00 to cover PayPal fees. +A one-term renewal via PayPal comes out to $2.37. + +

+

+ + + +
+

@@ -80,6 +90,6 @@ Each term, the CSC holds elections to determine the executive council: - Assistant Vice-President - Treasurer -To find out when and where the next elections will be held, keep an eye on on the [News](/). +To find out when and where the next elections will be held, keep an eye on on the [News](/#news). For details on the elections, see the [Constitution](/about/constitution). \ No newline at end of file diff --git a/content/meet-the-team/execs/01-kallen-tu.md b/content/meet-the-team/execs/01-kallen-tu.md index 9f8ffae8..24b41243 100644 --- a/content/meet-the-team/execs/01-kallen-tu.md +++ b/content/meet-the-team/execs/01-kallen-tu.md @@ -3,4 +3,4 @@ name: Kallen Tu role: President --- -words words words codey words words words words codey words words words words codey words words words words codey words words words words codey words words words words words codey words words words words codey words words words words codey words words words words codey words words words +Hello, I'm Kallen, a 4th year CS student. diff --git a/content/meet-the-team/execs/02-gordon-le.md b/content/meet-the-team/execs/02-gordon-le.md index a1a721f7..b565c869 100644 --- a/content/meet-the-team/execs/02-gordon-le.md +++ b/content/meet-the-team/execs/02-gordon-le.md @@ -3,4 +3,4 @@ name: Gordon Le role: Vice President --- -words words words codey words words words words codey words words words words codey words words words words codey words words words words codey words words words words words codey words words words words codey words words words words codey words words words words codey words words words +Hello everyone, I'm Gordon, and welcome to CSC! As a quick introduction, I'm a 4th year CS student at UW who enjoys playing ultimate frisbee, video games, music, and recently I've gotten into doing daily crossword puzzles. At CSC, we're always trying to support UW students in any way that we can, so please come and join us at our events 😄 If you ever see me on campus, please say hello! 👋 diff --git a/content/meet-the-team/execs/03-nakul-vijhani.md b/content/meet-the-team/execs/03-nakul-vijhani.md deleted file mode 100644 index 6c84a61c..00000000 --- a/content/meet-the-team/execs/03-nakul-vijhani.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -name: Nakul Vijhani -role: Assistant Vice President ---- - -words words words codey words words words words codey words words words words codey words words words words codey words words words words codey words words words words words codey words words words words codey words words words words codey words words words words codey words words words diff --git a/content/meet-the-team/execs/03-ravindu-angammana.md b/content/meet-the-team/execs/03-ravindu-angammana.md new file mode 100644 index 00000000..c0505004 --- /dev/null +++ b/content/meet-the-team/execs/03-ravindu-angammana.md @@ -0,0 +1,6 @@ +--- +name: Ravindu Angammana +role: Assistant Vice President +--- + +Hey guys! I'm Ravindu, a 4th year Software Engineering student here at UW. I joined CSC to help create a healthy community where like-minded students at UW could easily connect with each other. If you ever have the chance to come to one of our events, please do! I promise you won't regret it. When I'm not working, I'll typically be playing video games, listening to music, or planning out a new travel destination (for when COVID ends). Feel free to say hi if you ever see me around! diff --git a/content/meet-the-team/execs/04-neil-parikh.md b/content/meet-the-team/execs/04-neil-parikh.md index a8701efc..2f0e746b 100644 --- a/content/meet-the-team/execs/04-neil-parikh.md +++ b/content/meet-the-team/execs/04-neil-parikh.md @@ -3,4 +3,4 @@ name: Neil Parikh role: Treasurer --- -words words words codey words words words words codey words words words words codey words words words words codey words words words words codey words words words words words codey words words words words codey words words words words codey words words words words codey words words words +Hi, I'm Neil, a 4th year Mechatronics Engineering student. I've been a part of CSC since my first term at Waterloo, and it's been a great experience for me, so I'm excited to share that with you all! In my free time, you can find me climbing or longboarding down one of the trails in Waterloo (usually not at the same time!). diff --git a/content/meet-the-team/execs/05-max-erenberg.md b/content/meet-the-team/execs/05-max-erenberg.md index 6c480e18..c111da34 100644 --- a/content/meet-the-team/execs/05-max-erenberg.md +++ b/content/meet-the-team/execs/05-max-erenberg.md @@ -3,4 +3,4 @@ name: Max Erenberg role: Systems Administrator --- -words words words codey words words words words codey words words words words codey words words words words codey words words words words codey words words words words words codey words words words words codey words words words words codey words words words words codey words words words +Hello, I'm Max, a 4th year CS student. diff --git a/content/resources/services/cs-club-email.md b/content/resources/services/cs-club-email.md index d0b8fe33..ec061c1d 100644 --- a/content/resources/services/cs-club-email.md +++ b/content/resources/services/cs-club-email.md @@ -3,7 +3,7 @@ title: CS Club Email index: 2 --- -Members also receive a **username@csclub.uwaterloo.ca** email address. +Members also receive a **[username@csclub.uwaterloo.ca](#)** email address. - Mailboxes are considered as part of your disk quota, so your mailbox may grow up to the amount of disk quota you have. - Attachments of any file size or type may be sent. diff --git a/content/resources/services/mailing-lists.md b/content/resources/services/mailing-lists.md index b031e548..6dfc754d 100644 --- a/content/resources/services/mailing-lists.md +++ b/content/resources/services/mailing-lists.md @@ -3,8 +3,8 @@ title: Mailing Lists index: 10 --- -Our [csc-general mailing list](http://mailman.csclub.uwaterloo.ca/listinfo/csc-general) informs members about our current events. +Our [csc-general mailing list](https://mailman.csclub.uwaterloo.ca/postorius/lists/csc-general.csclub.uwaterloo.ca/) informs members about our current events. -Our [csc-industry mailing list](http://mailman.csclub.uwaterloo.ca/listinfo/csc-industry) allows students to opt-in to receiving emails from industry representatives. +Our [csc-industry mailing list](https://mailman.csclub.uwaterloo.ca/postorius/lists/csc-industry.csclub.uwaterloo.ca/) allows students to opt-in to receiving emails from industry representatives. - Corporate events, job postings, info sessions, and related events may be posted here. diff --git a/lib/events.ts b/lib/events.ts index 2007a89c..3cb7e621 100644 --- a/lib/events.ts +++ b/lib/events.ts @@ -179,28 +179,34 @@ export async function getEventsPageProps({ }; } -export function getCurrentTerm(): { year: string; term: string } { - const date = new Date(); - let term = ""; - const year = date.getUTCFullYear().toString(); +export function getCurrentTerm() { + const today = new Date().toLocaleDateString("en-CA", { + timeZone: "EST", + year: "numeric", + month: "numeric", + day: "numeric", + }); - if ( - new Date(`${year}-01-01 EST`).getTime() <= date.getTime() && - date.getTime() <= new Date(`${year}-04-30 EST`).getTime() - ) { + const [year] = today.split("-"); + + let term = ""; + + if (`${year}-01-01` <= today) { term = "winter"; - } else if ( - new Date(`${year}-05-01 EST`).getTime() <= date.getTime() && - date.getTime() <= new Date(`${year}-08-31 EST`).getTime() - ) { + } + + if (`${year}-05-01` <= today) { term = "spring"; - } else if ( - new Date(`${year}-09-01 EST`).getTime() <= date.getTime() && - date.getTime() <= new Date(`${year}-12-31 EST`).getTime() - ) { + } + + if (`${year}-09-01` <= today) { term = "fall"; } + if (term === "") { + throw new Error("Error setting the current term"); + } + return { year, term }; } @@ -211,7 +217,7 @@ function getPastTerm( const index = TERMS.indexOf(term); if (index === -1) { - throw new Error("Not a valid term"); + throw new Error(`[getPastTerm] Not a valid term: "${term}" "${year}"`); } return index === 0 @@ -232,7 +238,7 @@ function getFutureTerm( const index = TERMS.indexOf(term); if (index === -1) { - throw new Error("Not a valid term"); + throw new Error(`[getFutureTerm] Not a valid term: "${term}" "${year}"`); } return index === TERMS.length - 1 diff --git a/pages/about/index.module.css b/pages/about/index.module.css index 8f1d0528..547d2d1b 100644 --- a/pages/about/index.module.css +++ b/pages/about/index.module.css @@ -34,6 +34,10 @@ } @media only screen and (max-width: calc(768rem / 16)) { + .page { + margin-bottom: calc(30rem / 16); + } + .titleContainer { display: flex; flex-direction: column; diff --git a/pages/about/our-supporters.module.css b/pages/about/our-supporters.module.css index 6e6ccff6..8b8131cb 100644 --- a/pages/about/our-supporters.module.css +++ b/pages/about/our-supporters.module.css @@ -1,3 +1,7 @@ +.page { + margin-bottom: calc(60rem / 16); +} + .headerContainer { display: flex; flex-direction: row; @@ -18,6 +22,10 @@ } @media only screen and (max-width: calc(768rem / 16)) { + .page { + margin-bottom: calc(30rem / 16); + } + .headerContainer { flex-direction: column-reverse; align-items: center; diff --git a/pages/about/our-supporters.tsx b/pages/about/our-supporters.tsx index 7822957e..e40560d7 100644 --- a/pages/about/our-supporters.tsx +++ b/pages/about/our-supporters.tsx @@ -9,7 +9,7 @@ import styles from "./our-supporters.module.css"; export default function OurSupporters() { return ( - <> +
Our Supporters

Our Supporters

@@ -18,6 +18,6 @@ export default function OurSupporters() {
- +
); } diff --git a/pages/events/[year]/[term]/index.tsx b/pages/events/[year]/[term]/index.tsx index da884d3c..7073921f 100644 --- a/pages/events/[year]/[term]/index.tsx +++ b/pages/events/[year]/[term]/index.tsx @@ -83,9 +83,18 @@ export default function Term(props: Props) {
)} - {hasPastEvents && props.isCurrentTerm && ( + {hasPastEvents && (
-

Past Events

+ {props.isCurrentTerm ? ( +

Past Events

+ ) : ( +

+ Events Archive: + + {` ${capitalize(props.term)} ${props.year}`} + +

+ )}
{props.pastEvents.map(({ content, metadata }) => (
)} - {hasPastEvents && !props.isCurrentTerm && ( -

- Events Archive: - - {` ${capitalize(props.term)} ${props.year}`} - -

- )} {!hasFutureEvents && !hasPastEvents && ( <>

Events

@@ -114,16 +115,6 @@ export default function Term(props: Props) { later! )} -
- {props.pastEvents.map(({ content, metadata }) => ( - } - key={metadata.name + metadata.date.toString()} - /> - ))} -
); } diff --git a/pages/get-involved.module.css b/pages/get-involved.module.css index 6cc15303..1e0359fe 100644 --- a/pages/get-involved.module.css +++ b/pages/get-involved.module.css @@ -1,5 +1,5 @@ .page { - margin: calc(50rem / 16) 0; + margin: calc(60rem / 16) 0; } .page > header { @@ -51,6 +51,10 @@ } @media only screen and (max-width: calc(768rem / 16)) { + .page { + margin: calc(30rem / 16); + } + .page > header { display: flex; flex-direction: column-reverse; diff --git a/pages/index.module.css b/pages/index.module.css index e62ad859..61e6ff52 100644 --- a/pages/index.module.css +++ b/pages/index.module.css @@ -1,5 +1,5 @@ .page { - padding-bottom: calc(60rem / 16); + margin-bottom: calc(60rem / 16); } .intro { @@ -126,7 +126,7 @@ @media only screen and (max-width: calc(768rem / 16)) { .page { - padding-bottom: calc(30rem / 16); + margin-bottom: calc(30rem / 16); } .intro { diff --git a/pages/resources/advice/academic.tsx b/pages/resources/advice/academic.tsx index 19fb35ea..6e334657 100644 --- a/pages/resources/advice/academic.tsx +++ b/pages/resources/advice/academic.tsx @@ -4,7 +4,7 @@ import { Title } from "@/components/Title"; import Content from "../../../content/advice/academic-advice.mdx"; -import { Advice } from "./coop"; +import { Advice } from "./co-op"; export default function AcademicAdvice() { return ( diff --git a/pages/resources/advice/coop.module.css b/pages/resources/advice/co-op.module.css similarity index 100% rename from pages/resources/advice/coop.module.css rename to pages/resources/advice/co-op.module.css diff --git a/pages/resources/advice/coop.tsx b/pages/resources/advice/co-op.tsx similarity index 85% rename from pages/resources/advice/coop.tsx rename to pages/resources/advice/co-op.tsx index d46ebdf7..24bb551c 100644 --- a/pages/resources/advice/coop.tsx +++ b/pages/resources/advice/co-op.tsx @@ -5,9 +5,9 @@ import React, { ReactNode } from "react"; import { Image } from "@/components/Image"; import { Title } from "@/components/Title"; -import Content from "../../../content/advice/coop-advice.mdx"; +import Content from "../../../content/advice/co-op-advice.mdx"; -import styles from "./coop.module.css"; +import styles from "./co-op.module.css"; export default function CoopAdvice() { return ( @@ -30,13 +30,13 @@ export function Advice(props: { children: ReactNode }) {
- + - Coop Advice + Co-op Advice diff --git a/pages/resources/advice/index.tsx b/pages/resources/advice/index.tsx new file mode 100644 index 00000000..bcd13fcb --- /dev/null +++ b/pages/resources/advice/index.tsx @@ -0,0 +1,10 @@ +import Head from "next/head"; +import React from "react"; + +export default function AdviceRedirect() { + return ( + + + + ); +} diff --git a/pages/resources/advice/misc.tsx b/pages/resources/advice/misc.tsx index 3e9774d6..21ffabaa 100644 --- a/pages/resources/advice/misc.tsx +++ b/pages/resources/advice/misc.tsx @@ -4,7 +4,7 @@ import { Title } from "@/components/Title"; import Content from "../../../content/advice/misc-advice.mdx"; -import { Advice } from "./coop"; +import { Advice } from "./co-op"; export default function MiscAdvice() { return ( diff --git a/pages/resources/index.tsx b/pages/resources/index.tsx index 9a436de6..a60f39b2 100644 --- a/pages/resources/index.tsx +++ b/pages/resources/index.tsx @@ -1,7 +1,7 @@ import Head from "next/head"; import React from "react"; -export default function Resources() { +export default function ResourcesRedirect() { return (