Skip to content

Commit

Permalink
fix: 404page FOUC
Browse files Browse the repository at this point in the history
  • Loading branch information
liximomo committed May 20, 2020
1 parent 4c73355 commit a7bd021
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 42 deletions.
1 change: 0 additions & 1 deletion packages/runtime-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"files": [
"lib",
"es",
"style",
"client-env.d.ts",
"index.d.ts",
"index.js",
Expand Down
36 changes: 29 additions & 7 deletions packages/runtime-react/src/page404.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
import React from "react";
import React from 'react';
// @ts-ignore
import { Head } from "@shuvi/app";
import style from "../style/page404.css";
import { Head } from '@shuvi/app';

const style = {
container: {
color: '#000',
background: '#fff',
fontFamily:
'-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif',
height: '100vh',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center'
},
error: { display: 'flex', alignItems: 'center', justifyContent: 'center' },
errorCode: {
borderRight: '1px solid rgba(0, 0, 0, 0.3)',
paddingRight: '20px',
marginRight: '20px',
fontSize: '24px',
fontWeight: 500
},
errorDesc: { fontSize: '16px', lineHeight: '1' }
} as const;

export default function Page404() {
return (
<div className={style.container}>
<div style={style.container}>
<Head>
<title>404: Page not found</title>
</Head>

<div className={style.error}>
<div className={style.errorCode}>404</div>
<div className={style.errorDesc}>This page could not be found.</div>
<div style={style.error}>
<div style={style.errorCode}>404</div>
<div style={style.errorDesc}>This page could not be found.</div>
</div>
</div>
);
Expand Down
34 changes: 0 additions & 34 deletions packages/runtime-react/style/page404.css

This file was deleted.

0 comments on commit a7bd021

Please sign in to comment.