forked from www/www-new
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
49 lines
1.1 KiB
import React from "react";
|
|
|
|
import { capitalize } from "@/utils";
|
|
|
|
import { Link } from "./Link";
|
|
import {
|
|
ShapesConfig,
|
|
GetShapesConfig,
|
|
defaultGetShapesConfig,
|
|
} from "./ShapesBackground";
|
|
import { Title } from "./Title";
|
|
|
|
import styles from "./ArchivePage.module.css";
|
|
|
|
export interface Props {
|
|
type: "news" | "events";
|
|
items: {
|
|
year: string;
|
|
terms: string[];
|
|
}[];
|
|
}
|
|
|
|
export function ArchivePage({ items, type }: Props) {
|
|
return (
|
|
<>
|
|
<Title>{[capitalize(type), "Archive"]}</Title>
|
|
<div className={styles.page}>
|
|
<h1>{capitalize(type)} Archive</h1>
|
|
<ul className={styles.list}>
|
|
{items.map(({ year, terms }) =>
|
|
terms.map((term) => (
|
|
<li key={`/${type}/${year}/${term}`}>
|
|
<Link href={`/${type}/${year}/${term}`}>
|
|
{capitalize(term)} {year}
|
|
</Link>
|
|
</li>
|
|
))
|
|
)}
|
|
</ul>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|
|
|
|
ArchivePage.getShapesConfig = ((width, height) => {
|
|
return window.innerWidth <= 768
|
|
? ({} as ShapesConfig)
|
|
: defaultGetShapesConfig(width, height);
|
|
}) as GetShapesConfig;
|
|
|