From fadb031f7010354e57eda5c8e040fe370363fc27 Mon Sep 17 00:00:00 2001 From: Dhanush Adithya Date: Fri, 24 Jul 2020 16:54:01 +0000 Subject: [PATCH] ui(404): improve 404 page styling --- src/components/404LinkCorrection/index.tsx | 8 +++++--- src/components/404LinkCorrection/styles.tsx | 10 ++++++++++ src/pages/404.tsx | 7 +++++-- src/pages/archives/404.tsx | 7 +++++-- src/pages/resources/404.tsx | 7 +++++-- src/pages/styles.tsx | 21 +++++++++++++++++++++ 6 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 src/pages/styles.tsx diff --git a/src/components/404LinkCorrection/index.tsx b/src/components/404LinkCorrection/index.tsx index c420c70..a8d4070 100644 --- a/src/components/404LinkCorrection/index.tsx +++ b/src/components/404LinkCorrection/index.tsx @@ -95,11 +95,14 @@ export const PossibleCorrections: FC = ({ }) // helpful message if no matches found - const found = displayArray.length === 0 ? "Oops, nothing similar found." : "" + const found = displayArray.length === 0 ? Oops, nothing similar found. : "" return ( -

Based off of "{search}" you may have meant:

+ +

Based off of "{search}" you may have meant:

+ {found} +
    {displayArray.map((value, index) => { return ( @@ -111,7 +114,6 @@ export const PossibleCorrections: FC = ({ ) })}
- {found}
) } diff --git a/src/components/404LinkCorrection/styles.tsx b/src/components/404LinkCorrection/styles.tsx index 34496dd..c7cd027 100644 --- a/src/components/404LinkCorrection/styles.tsx +++ b/src/components/404LinkCorrection/styles.tsx @@ -14,3 +14,13 @@ export const StyledLink = styled(Link)` transition: none; } ` +export const StyledFound = styled.div` + margin: 13px 10px 10px; + padding: 10px; +` +export const StyledDiv = styled.div` + width: 100%; + display: flex; + align-items: center; + justify-content: center; +` \ No newline at end of file diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 4891f4f..193c255 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,4 +1,5 @@ import React, { Fragment } from "react" +import * as SC from "./styles" import { SEO } from "../components/SEO" @@ -6,8 +7,10 @@ function NotFoundPage() { return ( -

NOT FOUND

-

You just hit a route that doesn't exist... the sadness.

+ + NOT FOUND + You just hit a route that doesn't exist... the sadness. +
) } diff --git a/src/pages/archives/404.tsx b/src/pages/archives/404.tsx index 7db240a..b949ce3 100644 --- a/src/pages/archives/404.tsx +++ b/src/pages/archives/404.tsx @@ -1,6 +1,7 @@ import { Location } from "@reach/router" import { graphql } from "gatsby" import React, { Fragment } from "react" +import * as SC from "../styles" import { FileConnection } from "../../../generated/graphql" import { ComponentQuery } from "../../../typings" @@ -11,8 +12,10 @@ import { PossibleCorrections } from "../../components/404LinkCorrection" export default ({ data }: ComponentQuery<{ allFile: FileConnection }>) => ( -

RESOURCE NOT FOUND

-

You just hit a route that doesn't exist... the sadness.

+ + RESOURCE NOT FOUND + You just hit a route that doesn't exist... the sadness. + {({ location }) => ( ) => ( -

RESOURCE NOT FOUND

-

You just hit a route that doesn't exist... the sadness.

+ + RESOURCE NOT FOUND + You just hit a route that doesn't exist... the sadness. + {({ location }) => (