From 2d7fdae813f721d123bbf41d6f540da92edd4375 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Fri, 27 Nov 2020 14:08:18 -0500 Subject: [PATCH] random 404 message --- src/pages/404.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 6bba1b1..0e076ba 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,13 +1,17 @@ +import { PageProps } from 'gatsby'; import React from 'react'; import Navbar from "../components/navbar"; -export default ({ location }) => { - console.log(location); - return <> - +export default ({ location }: PageProps): JSX.Element => { + const messages = [

In your attempt to search for {location.pathname}, you seem to have gotten lost instead. Fret not, for there is always a path home. -

+

, +

Not all who wander are lost, but you seem to be. Go home?

+ ]; + return <> + + {messages[Math.floor(Math.random() * messages.length)]} ; -}; \ No newline at end of file +};