Commit f81d36c6 authored by chencheng's avatar chencheng

7. Handle loading state

parent 2c763479
...@@ -3,7 +3,7 @@ import { Table, Pagination, Popconfirm } from 'antd'; ...@@ -3,7 +3,7 @@ import { Table, Pagination, Popconfirm } from 'antd';
import styles from './Users.css'; import styles from './Users.css';
import { PAGE_SIZE } from '../constants'; import { PAGE_SIZE } from '../constants';
function Users({ list: dataSource, total, page: current }) { function Users({ list: dataSource, loading, total, page: current }) {
function deleteHandler(id) { function deleteHandler(id) {
console.warn(`TODO: ${id}`); console.warn(`TODO: ${id}`);
} }
...@@ -43,6 +43,7 @@ function Users({ list: dataSource, total, page: current }) { ...@@ -43,6 +43,7 @@ function Users({ list: dataSource, total, page: current }) {
<div className={styles.normal}> <div className={styles.normal}>
<div> <div>
<Table <Table
loading={loading}
columns={columns} columns={columns}
dataSource={dataSource} dataSource={dataSource}
rowKey={record => record.id} rowKey={record => record.id}
...@@ -65,6 +66,7 @@ function mapStateToProps(state) { ...@@ -65,6 +66,7 @@ function mapStateToProps(state) {
list, list,
total, total,
page, page,
loading: state.loading.models.users,
}; };
} }
......
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