random 404 message

master
Edward Shen 2020-11-27 14:08:18 -05:00
parent 333bbb9869
commit 2d7fdae813
Signed by: edward
GPG Key ID: F350507060ED6C90
1 changed files with 10 additions and 6 deletions

View File

@ -1,13 +1,17 @@
import { PageProps } from 'gatsby';
import React from 'react';
import Navbar from "../components/navbar";
export default ({ location }) => {
console.log(location);
return <>
<Navbar />
export default ({ location }: PageProps): JSX.Element => {
const messages = [
<p>
In your attempt to search for <code>{location.pathname}</code>, you seem to
have gotten lost instead. Fret not, for there is always a path <a href="/">home</a>.
</p>
</p>,
<p>Not all who wander are lost, but you seem to be. Go <a href="/">home</a>?</p>
];
return <>
<Navbar />
{messages[Math.floor(Math.random() * messages.length)]}
</>;
};
};