Skip to content

Commit 44b0251

Browse files
committed
feat(notfound): use empty rewrite notfound
1 parent d56f9e1 commit 44b0251

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

src/notFound/__tests__/notFound.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('test NotFound', () => {
99

1010
test('renders not found message', () => {
1111
const { getByText } = render(<NotFound />);
12-
const element = getByText(//i);
12+
const element = getByText(/访/i);
1313
expect(element).toBeInTheDocument();
1414
});
1515
});

src/notFound/index.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
import React from 'react';
2-
import { FrownOutlined } from '@ant-design/icons';
32
import classNames from 'classnames';
43

4+
import Empty from '../empty';
55
import './style.scss';
66

7-
const NotFound: React.FC<any> = function ({
8-
className,
9-
style,
10-
}: {
7+
interface INotFoundProps {
118
className?: string;
129
style?: React.CSSProperties;
13-
}) {
10+
}
11+
12+
const NotFound: React.FC<INotFoundProps> = function ({ className, style }) {
1413
return (
1514
<div className={classNames('dtc-not-found', className)} style={style}>
16-
<h1>
17-
<FrownOutlined /> 亲,是不是走错地方了?
18-
</h1>
15+
<Empty
16+
type="notFound"
17+
description="抱歉,您访问的页面不存在"
18+
className="dtc-not-found__empty"
19+
imageStyle={{ height: 250 }}
20+
/>
1921
</div>
2022
);
2123
};

src/notFound/style.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.dtc-not-found {
2-
line-height: 200px;
3-
text-align: center;
2+
margin-top: 160px;
3+
width: 100%;
4+
display: flex;
5+
justify-content: center;
46
}

0 commit comments

Comments
 (0)