From 28ac9012ffec0c08cb554acc1ed84213d0e34e73 Mon Sep 17 00:00:00 2001 From: DrMint Date: Sat, 12 Mar 2022 14:03:26 +0100 Subject: [PATCH] Fixed errors that prevented building --- src/components/Switch.tsx | 2 +- src/pages/contents/[slug]/read.tsx | 32 +++++++++++++++++------------- src/pages/wiki/chronology.tsx | 10 ++++------ src/pages/wiki/index.tsx | 2 +- tailwind.config.js | 1 - 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/components/Switch.tsx b/src/components/Switch.tsx index 6f33b96..72cb871 100644 --- a/src/components/Switch.tsx +++ b/src/components/Switch.tsx @@ -6,7 +6,7 @@ export type SwitchProps = { className?: string; }; -export default function Select(props: SwitchProps): JSX.Element { +export default function Switch(props: SwitchProps): JSX.Element { return (
)} - - 0 - ? prettyinlineTitle( - content.titles[0].pre_title, - content.titles[0].title, - content.titles[0].subtitle - ) - : prettySlug(content.slug) - } - /> + {content.text_set.length > 0 && content.text_set[0].text && ( + <> + + 0 + ? prettyinlineTitle( + content.titles[0].pre_title, + content.titles[0].title, + content.titles[0].subtitle + ) + : prettySlug(content.slug) + } + /> + + )} ); const contentPanel = ( @@ -172,7 +176,7 @@ export default function ContentRead(props: ContentReadProps): JSX.Element { - {content.text_set.length > 0 && ( + {content.text_set.length > 0 && content.text_set[0].text && ( )}
diff --git a/src/pages/wiki/chronology.tsx b/src/pages/wiki/chronology.tsx index 1a58ac2..b006c03 100644 --- a/src/pages/wiki/chronology.tsx +++ b/src/pages/wiki/chronology.tsx @@ -19,14 +19,12 @@ import { useRouter } from "next/router"; import ReactTooltip from "react-tooltip"; import { AppStaticProps, getAppStaticProps } from "queries/getAppStaticProps"; -interface DataChronologyProps extends AppStaticProps { +interface ChronologyProps extends AppStaticProps { chronologyItems: GetChronologyItemsQuery["chronologyItems"]["data"]; chronologyEras: GetErasQuery["chronologyEras"]["data"]; } -export default function DataChronology( - props: DataChronologyProps -): JSX.Element { +export default function Chronology(props: ChronologyProps): JSX.Element { useTesting(props); const { chronologyItems, chronologyEras } = props; @@ -133,7 +131,7 @@ export default function DataChronology( } export const getStaticProps: GetStaticProps = async (context) => { - const props: DataChronologyProps = { + const props: ChronologyProps = { ...(await getAppStaticProps(context)), chronologyItems: ( await getChronologyItems({ @@ -148,7 +146,7 @@ export const getStaticProps: GetStaticProps = async (context) => { }; }; -function useTesting(props: DataChronologyProps) { +function useTesting(props: ChronologyProps) { const router = useRouter(); const { chronologyItems, chronologyEras } = props; chronologyEras.map((era) => { diff --git a/src/pages/wiki/index.tsx b/src/pages/wiki/index.tsx index 1b0b1f1..463b482 100644 --- a/src/pages/wiki/index.tsx +++ b/src/pages/wiki/index.tsx @@ -6,7 +6,7 @@ import { AppStaticProps, getAppStaticProps } from "queries/getAppStaticProps"; interface WikiProps extends AppStaticProps {} -export default function Hubs(props: WikiProps): JSX.Element { +export default function Wiki(props: WikiProps): JSX.Element { const { langui } = props; const subPanel = ( diff --git a/tailwind.config.js b/tailwind.config.js index 4a84db7..0f9f6b4 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -72,7 +72,6 @@ module.exports = { }, }, plugins: [ - require("@tailwindcss/typography"), plugin(function ({ addUtilities }) { addUtilities({