Simplify

pull/245/head
Jared He 2 years ago
parent aba5f2ea8a
commit dbf978dec7
  1. 33
      pages/events/[year]/[term]/index.tsx

@ -83,29 +83,18 @@ export default function Term(props: Props) {
</div>
</section>
)}
{hasPastEvents && props.isCurrentTerm && (
{hasPastEvents && (
<section>
<h1>Past Events</h1>
<div className={styles.miniEventCards}>
{props.pastEvents.map(({ content, metadata }) => (
<MiniEventCard
{...metadata}
date={new Date(metadata.date)}
description={<MDXRemote {...content} />}
key={metadata.name + metadata.date.toString()}
/>
))}
</div>
</section>
)}
{hasPastEvents && !props.isCurrentTerm && (
<section>
<h1>
Events Archive:
<span className={styles.blue}>
{` ${capitalize(props.term)} ${props.year}`}
</span>
</h1>
{props.isCurrentTerm ? (
<h1>Past Events</h1>
) : (
<h1>
Events Archive:
<span className={styles.blue}>
{` ${capitalize(props.term)} ${props.year}`}
</span>
</h1>
)}
<div className={styles.miniEventCards}>
{props.pastEvents.map(({ content, metadata }) => (
<MiniEventCard

Loading…
Cancel
Save