feat: dashboard style.

This commit is contained in:
Ahmed Bouhuolia
2020-04-12 12:03:45 +02:00
parent 6dcff7e4c2
commit 37fb5a6f11
24 changed files with 517 additions and 201 deletions

View File

@@ -1,31 +1,13 @@
import {connect} from 'react-redux';
import {
fetchAccountTypes,
fetchAccountsList,
submitAccount,
fetchAccount,
editAccount,
} from 'store/accounts/accounts.actions';
import {getDialogPayload} from 'store/dashboard/dashboard.reducer';
import t from 'store/types';
export const mapStateToProps = (state, props) => {
const dialogPayload = getDialogPayload(state, 'account-form');
return {
accountsTypes: state.accounts.accountsTypes,
accounts: state.accounts.accounts,
name: 'account-form',
payload: {action: 'new', id: null},
editAccount: dialogPayload && dialogPayload.action === 'edit'
? state.accounts.accountsById[dialogPayload.id] : {},
payload: {action: 'new', id: null, ...dialogPayload},
};
};
export const mapDispatchToProps = (dispatch) => ({
submitAccount: ({ form }) => dispatch(submitAccount({ form })),
fetchAccounts: () => dispatch(fetchAccountsList()),
fetchAccountTypes: () => dispatch(fetchAccountTypes()),
fetchAccount: (id) => dispatch(fetchAccount({ id })),
});
export default connect(mapStateToProps, mapDispatchToProps);
export default connect(mapStateToProps);