From 74cc2a3aafbf0fe459012f37030c0c3940c8a579 Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Fri, 16 Oct 2020 13:31:04 +0300 Subject: [PATCH] fix console errors --- lib/apollo.ts | 2 +- scenes/Layout/components/Footer.tsx | 6 ++---- scenes/Layout/components/IconNavBar.tsx | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/apollo.ts b/lib/apollo.ts index f9e4569d6..d49fcf6f3 100644 --- a/lib/apollo.ts +++ b/lib/apollo.ts @@ -10,7 +10,7 @@ import { useMemo } from "react"; let apolloClient: ApolloClient | undefined; -function createIsomorphLink(context: ResolverContext = {}) { +function createIsomorphLink(context: Context | {} = {}) { if (typeof window === "undefined") { const { SchemaLink } = require("@apollo/client/link/schema"); const { schema } = require("graphql/schema"); diff --git a/scenes/Layout/components/Footer.tsx b/scenes/Layout/components/Footer.tsx index 7f9e01835..9824a2ef1 100644 --- a/scenes/Layout/components/Footer.tsx +++ b/scenes/Layout/components/Footer.tsx @@ -4,14 +4,12 @@ import footerOctoLight from "assets/b8ing_light.png"; import footerSquidDark from "assets/boing_dark.png"; import footerSquidLight from "assets/boing_light.png"; import { useMyTheme } from "lib/useMyTheme"; -import { useState } from "react"; +import { useRouter } from "next/dist/client/router"; import FooterContent from "./FooterContent"; import FooterWaves from "./FooterWaves"; const Footer: React.FC = () => { - const [species] = useState<"octo" | "squid">( - Math.random() > 0.5 ? "octo" : "squid" - ); + const species = useRouter().asPath.charCodeAt(1) % 2 === 0 ? "squid" : "octo"; const { themeColor } = useMyTheme(); const footerImageSrc = useColorModeValue( { octo: footerOctoLight, squid: footerSquidLight }, diff --git a/scenes/Layout/components/IconNavBar.tsx b/scenes/Layout/components/IconNavBar.tsx index f464e1667..f8c930721 100644 --- a/scenes/Layout/components/IconNavBar.tsx +++ b/scenes/Layout/components/IconNavBar.tsx @@ -136,7 +136,9 @@ const IconNavBar = () => { if (!menuItems.length) { return ( - + + + ); }