From a9da8dff4b60e07bda45b64295ac8020e2205df7 Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Sun, 30 May 2021 15:55:36 +0300 Subject: [PATCH] Splatoon 3 page small fixes --- components/layout/Header.tsx | 7 ++++++- hooks/common.ts | 7 ++++--- pages/splatoon3/[[...slug]].tsx | 7 ++++++- utils/strings.ts | 4 ++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx index b74dc373e..75d700fe0 100644 --- a/components/layout/Header.tsx +++ b/components/layout/Header.tsx @@ -58,7 +58,12 @@ const Header = ({ openNav }: { openNav: () => void }) => { <> -{" "} { }; export const useActiveNavItem = () => { - const [navItem, setNavItem] = useState< - undefined | { code: string; name: string } - >(undefined); + const [navItem, setNavItem] = + useState( + undefined + ); const router = useRouter(); const firstPath = router.pathname.split("/")[1]; diff --git a/pages/splatoon3/[[...slug]].tsx b/pages/splatoon3/[[...slug]].tsx index 06b12f102..47b65678d 100644 --- a/pages/splatoon3/[[...slug]].tsx +++ b/pages/splatoon3/[[...slug]].tsx @@ -4,6 +4,7 @@ import MyLink from "components/common/MyLink"; import Video from "components/common/Video"; import type { GetStaticPaths, GetStaticProps } from "next"; import Image from "next/image"; +import { capitalizeFirstLetter } from "utils/strings"; import * as z from "zod"; const pages = { @@ -61,7 +62,11 @@ export const getStaticProps: GetStaticProps = async ({ params }) => { const Splatoon3Page = ({ page }: Props) => { return ( <> - + { return undefined; }; + +export const capitalizeFirstLetter = (string: string) => { + return string.charAt(0).toUpperCase() + string.slice(1); +};