From a3ae493c25f23fdeabd0e9ac8475471d1b2aace1 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 18 Mar 2021 14:18:29 +0100 Subject: [PATCH] Layout extraction refactoring --- components/CustomError.tsx | 58 +++++++----------- components/LangSelect.tsx | 1 - components/Layout.tsx | 52 ++++++++++++++++ components/index.tsx | 3 +- pages/[[...slug]].tsx | 121 ++++++++++++++----------------------- 5 files changed, 120 insertions(+), 115 deletions(-) create mode 100644 components/Layout.tsx diff --git a/components/CustomError.tsx b/components/CustomError.tsx index a358c97..6508fc7 100644 --- a/components/CustomError.tsx +++ b/components/CustomError.tsx @@ -1,9 +1,7 @@ import { FC } from "react"; -import Head from "next/head"; -import { Stack, VStack, HStack, Heading, Text, Icon, useColorModeValue } from "@chakra-ui/react"; +import { Stack, HStack, Heading, Text, Icon, useColorModeValue } from "@chakra-ui/react"; import { FaSadTear } from "react-icons/fa"; -import Header from "./Header"; -import Footer from "./Footer"; +import Layout from "./Layout"; const statusTexts: { [key: string]: string @@ -20,38 +18,26 @@ type Props = { }; const CustomError: FC = ({ statusCode }) => ( - <> - - - {statusCode} - {statusTexts?.[statusCode] ?? statusTexts.fallback} - - - - - -
- - - - {statusCode} - - - - - {statusTexts?.[statusCode] ?? statusTexts.fallback} - - -