Unverified Commit 243cc7e3 authored by 陈帅's avatar 陈帅 Committed by GitHub

feat : fix #4565, add 404 page (#4588)

* fix #4565,add 404 page

* fix codacy warning

* add 404 in fetch:blocks

* rm NoticeIconView import
parent 4a10734d
......@@ -93,8 +93,14 @@ export default {
icon: 'smile',
component: './Welcome',
},
{
component: './404',
},
],
},
{
component: './404',
},
],
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
theme: {
......
......@@ -41,6 +41,9 @@ const findAllInstallRouter = router => {
const filterParentRouter = (router, layout) => {
return [...router]
.map(item => {
if (!item.path && item.component === '404') {
return item;
}
if (item.routes && (!router.component || layout)) {
return { ...item, routes: filterParentRouter(item.routes, false) };
}
......
......@@ -19,6 +19,7 @@ export interface NoticeIconTabProps {
emptyText?: string;
clearText?: string;
viewMoreText?: string;
list: NoticeIconData[];
onViewMore?: (e: any) => void;
}
const NoticeList: React.SFC<NoticeIconTabProps> = ({
......
......@@ -117,7 +117,7 @@ export default class NoticeIcon extends Component<NoticeIconProps> {
},
);
return (
<Spin spinning={loading} delay={0}>
<Spin spinning={loading} delay={300}>
<Tabs className={styles.tabs} onChange={this.onTabChange}>
{panes}
</Tabs>
......
......@@ -7,6 +7,7 @@ import { queryNotices } from '@/services/user';
export interface NoticeItem extends NoticeIconData {
id: string;
type: string;
status: string;
}
export interface GlobalModelState {
......
import React from 'react';
import { Button } from 'antd';
// 这里应该使用 antd 的 404 result 组件,
// 但是还没发布,先来个简单的。
const NoFoundPage: React.FC<{}> = () => (
<div
style={{
height: '100vh',
padding: 80,
textAlign: 'center',
}}
>
<img src="https://gw.alipayobjects.com/zos/antfincdn/wsE2Pw%243%26L/noFound.svg" alt="404" />
<br />
<br />
<h1>404</h1>
<p>Sorry, the page you visited does not exist.</p>
<Button type="primary">Back Home</Button>
</div>
);
export default NoFoundPage;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment