forked from Agontuk/schema-designer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTables.js
34 lines (31 loc) · 800 Bytes
/
Tables.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* @flow
*/
import { connect } from 'react-redux';
import Tables from '../components/Tables';
import {
removeTable,
enableTableEdit,
toggleTableModal,
toggleColumnModal,
storeTablePosition
} from '../actions/ActionCreators';
const mapStateToProps = (state) => ({
tables: state.tables
});
const mapDispatchToProps = (dispatch) => ({
removeTable: (id) => {
dispatch(removeTable(id));
},
editTable: (data) => {
dispatch(enableTableEdit(data));
dispatch(toggleTableModal());
},
toggleColumnModal: (tableId) => {
dispatch(toggleColumnModal(tableId));
},
storeTablePosition: (newPos) => {
dispatch(storeTablePosition(newPos));
}
});
export default connect(mapStateToProps, mapDispatchToProps)(Tables);