From 6621a4caa39031989716f039c55642d7d5a0d126 Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Mon, 24 Oct 2022 15:16:21 -0700 Subject: [PATCH] add default not found template --- packages/next/client/components/error.tsx | 76 +++++++++++++++++++ packages/next/server/app-render.tsx | 27 ++++--- test/e2e/app-dir/app-static.test.ts | 10 +++ .../app/blog/[author]/[slug]/page.js | 6 ++ 4 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 packages/next/client/components/error.tsx diff --git a/packages/next/client/components/error.tsx b/packages/next/client/components/error.tsx new file mode 100644 index 0000000000000..78eb9fb939b36 --- /dev/null +++ b/packages/next/client/components/error.tsx @@ -0,0 +1,76 @@ +import React from 'react' + +const styles: { [k: string]: React.CSSProperties } = { + error: { + fontFamily: + '-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif', + height: '100vh', + textAlign: 'center', + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + justifyContent: 'center', + }, + + desc: { + display: 'inline-block', + textAlign: 'left', + lineHeight: '49px', + height: '49px', + verticalAlign: 'middle', + }, + + h1: { + display: 'inline-block', + margin: 0, + marginRight: '20px', + padding: '0 23px 0 0', + fontSize: '24px', + fontWeight: 500, + verticalAlign: 'top', + lineHeight: '49px', + }, + + h2: { + fontSize: '14px', + fontWeight: 'normal', + lineHeight: '49px', + margin: 0, + padding: 0, + }, +} + +export function NotFound() { + return ( +
+ + 404: This page could not be found. + +
+