Change news archive shapes background
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Amy 2021-08-26 21:31:34 -04:00
parent a14d6401b4
commit 392ff923ed
2 changed files with 22 additions and 0 deletions

View File

@ -5,6 +5,11 @@ import { MDXRemote } from "next-mdx-remote";
import React from "react"; import React from "react";
import { NewsCard } from "@/components/NewsCard"; import { NewsCard } from "@/components/NewsCard";
import {
ShapesConfig,
defaultGetShapesConfig,
GetShapesConfig,
} from "@/components/ShapesBackground";
import { import {
getNewsBySlug, getNewsBySlug,
getNewsByTerm, getNewsByTerm,
@ -44,6 +49,12 @@ export default function TermNews({ year, term, news }: Props) {
); );
} }
TermNews.getShapesConfig = ((width, height) => {
return window.innerWidth <= 768
? ({} as ShapesConfig)
: defaultGetShapesConfig(width, height);
}) as GetShapesConfig;
export const getStaticProps: GetStaticProps<Props, Params> = async ( export const getStaticProps: GetStaticProps<Props, Params> = async (
context context
) => { ) => {

View File

@ -3,6 +3,11 @@ import { GetStaticProps } from "next";
import React from "react"; import React from "react";
import { Link } from "@/components/Link"; import { Link } from "@/components/Link";
import {
ShapesConfig,
GetShapesConfig,
defaultGetShapesConfig,
} from "@/components/ShapesBackground";
import styles from "./archive.module.css"; import styles from "./archive.module.css";
@ -32,6 +37,12 @@ export default function NewsArchive({ items }: Props) {
); );
} }
NewsArchive.getShapesConfig = ((width, height) => {
return window.innerWidth <= 768
? ({} as ShapesConfig)
: defaultGetShapesConfig(width, height);
}) as GetShapesConfig;
export const getStaticProps: GetStaticProps<Props> = async () => { export const getStaticProps: GetStaticProps<Props> = async () => {
const years = (await getNewsYears()).reverse(); const years = (await getNewsYears()).reverse();
const yearsWithTerms = await Promise.all( const yearsWithTerms = await Promise.all(