From fe26f899a68201e7b98bb64d5115fd696436e53a Mon Sep 17 00:00:00 2001 From: ddcat1115 Date: Mon, 8 Jan 2018 14:27:40 +0800 Subject: [PATCH] remove useless code --- src/components/GlobalHeader/index.js | 4 +- src/routes/Dashboard.css | 5 -- src/routes/Dashboard.js | 101 --------------------------- src/routes/Dashboard.test.js | 12 ---- 4 files changed, 2 insertions(+), 120 deletions(-) delete mode 100644 src/routes/Dashboard.css delete mode 100644 src/routes/Dashboard.js delete mode 100644 src/routes/Dashboard.test.js diff --git a/src/components/GlobalHeader/index.js b/src/components/GlobalHeader/index.js index 222002c2..f7da5f32 100644 --- a/src/components/GlobalHeader/index.js +++ b/src/components/GlobalHeader/index.js @@ -4,8 +4,8 @@ import moment from 'moment'; import groupBy from 'lodash/groupBy'; import Debounce from 'lodash-decorators/debounce'; import { Link } from 'dva/router'; -import NoticeIcon from '../../components/NoticeIcon'; -import HeaderSearch from '../../components/HeaderSearch'; +import NoticeIcon from '../NoticeIcon'; +import HeaderSearch from '../HeaderSearch'; import styles from './index.less'; const { Header } = Layout; diff --git a/src/routes/Dashboard.css b/src/routes/Dashboard.css deleted file mode 100644 index 3f7685d1..00000000 --- a/src/routes/Dashboard.css +++ /dev/null @@ -1,5 +0,0 @@ -.normal { - font-family: Georgia, sans-serif; - margin-top: 3em; - text-align: center; -} diff --git a/src/routes/Dashboard.js b/src/routes/Dashboard.js deleted file mode 100644 index 1e9bc820..00000000 --- a/src/routes/Dashboard.js +++ /dev/null @@ -1,101 +0,0 @@ -import React, { PureComponent } from 'react'; -import { connect } from 'dva'; -import { Row, Col, Card, Table, Icon, Divider } from 'antd'; - -const columns = [{ - title: 'Name', - dataIndex: 'name', - key: 'name', -}, { - title: 'Age', - dataIndex: 'age', - key: 'age', -}, { - title: 'Address', - dataIndex: 'address', - key: 'address', -}, { - title: 'Action', - key: 'action', - render: (text, record) => ( - - Action 一 {record.name} - - Delete - - - More actions - - - ), -}]; - -class Dashboard extends PureComponent { - componentDidMount() { - this.props.dispatch({ - type: 'user/fetch', - }); - } - render() { - const { user: { list }, loading } = this.props; - return ( -
- - - -

卡片内容

-

卡片内容

-

卡片内容

-
- - - -

卡片内容

-

卡片内容

-

卡片内容

-
- - - -

卡片内容

-

卡片内容

-

卡片内容

-
- -
- - - -

卡片内容

-

卡片内容

-

卡片内容

-
- - - -

卡片内容

-

卡片内容

-

卡片内容

-
- -
- - - } - > - - - - - - ); - } -} - -export default connect(({ user, loading }) => ({ - user, - loading: loading.effects['user/fetch'], -}))(Dashboard); diff --git a/src/routes/Dashboard.test.js b/src/routes/Dashboard.test.js deleted file mode 100644 index 51605602..00000000 --- a/src/routes/Dashboard.test.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { shallow } from 'enzyme'; -import Dashboard from './Dashboard'; - -it('renders Dashboard', () => { - const fetchFn = jest.fn(); - const wrapper = shallow( - - ); - expect(wrapper.find('Table').props().dataSource).toEqual([]); - expect(fetchFn).toBeCalled(); -}); -- GitLab