2019-06-03 12:41:45 +00:00
|
|
|
import { connect } from 'react-redux';
|
2019-08-22 13:10:47 +00:00
|
|
|
import { getClients } from '../actions';
|
|
|
|
import { getStats } from '../actions/stats';
|
2019-06-03 12:41:45 +00:00
|
|
|
import { addClient, updateClient, deleteClient, toggleClientModal } from '../actions/clients';
|
|
|
|
import Clients from '../components/Settings/Clients';
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
2019-08-22 13:10:47 +00:00
|
|
|
const { dashboard, clients, stats } = state;
|
2019-06-03 12:41:45 +00:00
|
|
|
const props = {
|
|
|
|
dashboard,
|
|
|
|
clients,
|
2019-08-22 13:10:47 +00:00
|
|
|
stats,
|
2019-06-03 12:41:45 +00:00
|
|
|
};
|
|
|
|
return props;
|
|
|
|
};
|
|
|
|
|
|
|
|
const mapDispatchToProps = {
|
2019-06-05 12:49:01 +00:00
|
|
|
getClients,
|
2019-08-22 13:10:47 +00:00
|
|
|
getStats,
|
2019-06-03 12:41:45 +00:00
|
|
|
addClient,
|
|
|
|
updateClient,
|
|
|
|
deleteClient,
|
|
|
|
toggleClientModal,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
mapStateToProps,
|
|
|
|
mapDispatchToProps,
|
|
|
|
)(Clients);
|