Use children for Title

This commit is contained in:
Aditya Thakral 2021-08-30 11:46:04 -04:00
parent 76d0c30a3e
commit 4e6e1c0ddc
19 changed files with 23 additions and 24 deletions

View File

@ -23,7 +23,7 @@ export interface Props {
export function ArchivePage({ items, type }: Props) {
return (
<>
<Title path={[capitalize(type), "Archive"]} />
<Title>{[capitalize(type), "Archive"]}</Title>
<div className={styles.page}>
<h1>{capitalize(type)} Archive</h1>
<ul className={styles.list}>

View File

@ -59,7 +59,7 @@ export function createReadAllPage({
return (
<>
<Title path={title} />
<Title>{title}</Title>
<Header
title={title}
image={image}

View File

@ -33,7 +33,7 @@ export function createSectionPage({
function Page(this: void, { content, sections, current }: Props) {
return (
<>
<Title path={[sections[current].title, title]} />
<Title>{[sections[current].title, title]}</Title>
<Header
title={title}
image={image}

View File

@ -2,17 +2,18 @@ import Head from "next/head";
import React from "react";
interface Props {
path: string | string[];
children: string | string[];
}
export function Title(props: Props) {
const paths = typeof props.path === "string" ? [props.path] : props.path;
const children =
typeof props.children === "string" ? [props.children] : props.children;
paths.push("UWaterloo Computer Science Club");
children.push("UWaterloo Computer Science Club");
return (
<Head>
<title>{paths.join(" - ")}</title>
<title>{children.join(" - ")}</title>
</Head>
);
}

View File

@ -17,7 +17,7 @@ import styles from "./index.module.css";
export default function AboutUs() {
return (
<>
<Title path="About" />
<Title>About</Title>
<div className={styles.titleContainer}>
<h1 className={styles.title}>About Us!</h1>
<Image src="/images/about-us.svg" className={styles.codey} />

View File

@ -10,7 +10,7 @@ import styles from "./our-supporters.module.css";
export default function OurSupporters() {
return (
<>
<Title path="Our Supporters" />
<Title>Our Supporters</Title>
<div className={styles.headerContainer}>
<h1 className={styles.header}>Our Supporters</h1>
<Image src="images/our-supporters/codey.svg" className={styles.codey} />

View File

@ -37,7 +37,7 @@ interface Props {
export default function Team({ execs, programme, website, systems }: Props) {
return (
<>
<Title path="Team" />
<Title>Team</Title>
<DefaultLayout>
<div className={styles.headerContainer}>
<div className={styles.headerTextContainer}>

View File

@ -17,7 +17,7 @@ import {
export default function EventInfoPage(props: Props) {
return (
<>
<Title path={props.event.metadata.name} />
<Title>{props.event.metadata.name}</Title>
<EventCard
{...props.event.metadata}
date={new Date(props.event.metadata.date)}

View File

@ -55,9 +55,7 @@ export default function Term(props: Props) {
return (
<div className={styles.main}>
<Title
path={["Events", `${capitalize(props.term)} ${capitalize(props.year)}`]}
/>
<Title>{["Events", `${capitalize(props.term)} ${props.year}`]}</Title>
<div className={styles.header}>
{headerTerms.map((link) => (
<HeaderLink

View File

@ -17,7 +17,7 @@ interface Props {
export default function Year(props: Props) {
return (
<div className={styles.main}>
<Title path={["Events", props.year]} />
<Title>{["Events", props.year]}</Title>
<h2>
Events Archive:<span className={styles.blue}>{` ${props.year}`}</span>
</h2>

View File

@ -12,7 +12,7 @@ import styles from "./get-involved.module.css";
export default function GetInvolved() {
return (
<div className={styles.page}>
<Title path="Get Involved" />
<Title>Get Involved</Title>
<header>
<div className={styles.headerText}>
<h1>Get Involved!</h1>

View File

@ -26,7 +26,7 @@ interface Props {
export default function Home(props: Props) {
return (
<>
<Title path={[]} />
<Title>{[]}</Title>
<DefaultLayout>
<header className={styles.intro}>
<div className={styles.introTop} />

View File

@ -31,7 +31,7 @@ interface Props {
export default function TermNews({ year, term, news }: Props) {
return (
<div className={styles.page}>
<Title path={["News", `${capitalize(term)} ${capitalize(year)}`]} />
<Title>{["News", `${capitalize(term)} ${capitalize(year)}`]}</Title>
<h1>
News Archive:{" "}
<span className={styles.term}>

View File

@ -9,7 +9,7 @@ import { Advice } from "./coop";
export default function AcademicAdvice() {
return (
<>
<Title path="Academic Advice" />
<Title>Academic Advice</Title>
<Advice>
<Content />
</Advice>

View File

@ -12,7 +12,7 @@ import styles from "./coop.module.css";
export default function CoopAdvice() {
return (
<>
<Title path="Co-op Advice" />
<Title>Co-op Advice</Title>
<Advice>
<Content />
</Advice>

View File

@ -9,7 +9,7 @@ import { Advice } from "./coop";
export default function MiscAdvice() {
return (
<>
<Title path="Misc Advice" />
<Title>Misc Advice</Title>
<Advice>
<Content />
</Advice>

View File

@ -20,7 +20,7 @@ interface Props {
export default function TechTalk({ content, metadata }: Props) {
return (
<div className={styles.page}>
<Title path={[metadata.title, "Tech Talks"]} />
<Title>{[metadata.title, "Tech Talks"]}</Title>
<Header />
<TechTalkCard
{...metadata}

View File

@ -15,7 +15,7 @@ interface Props {
export default function TechTalks({ talks }: Props) {
return (
<div className={styles.page}>
<Title path="Tech Talks" />
<Title>Tech Talks</Title>
<Header />
<div className={styles.miniCards}>
{talks.map((talk) => (

View File

@ -13,7 +13,7 @@ export default function Themer() {
return (
<main className={styles.page}>
<Title path="Themer" />
<Title>Themer</Title>
<h1>Themer</h1>
<form onSubmit={(event) => event.preventDefault()}>
<div className={styles.controls}>