1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2024-11-17 03:50:05 -05:00
moneygo/js/containers/MoneyGoAppContainer.js

34 lines
1.2 KiB
JavaScript

var connect = require('react-redux').connect;
var UserActions = require('../actions/UserActions');
var AccountActions = require('../actions/AccountActions');
var TransactionActions = require('../actions/TransactionActions');
var SecurityTemplateActions = require('../actions/SecurityTemplateActions');
var MoneyGoApp = require('../components/MoneyGoApp');
function mapStateToProps(state) {
return {
user: state.user,
accounts: state.accounts.map,
accountChildren: state.accounts.children,
selectedAccount: state.selectedAccount,
security_list: state.securities.list,
}
}
function mapDispatchToProps(dispatch) {
return {
tryResumingSession: function() {dispatch(UserActions.tryResumingSession())},
fetchCurrencies: function() {dispatch(SecurityTemplateActions.fetchCurrencies())},
onCreateAccount: function(account) {dispatch(AccountActions.create(account))},
onSelectAccount: function(accountId) {dispatch(AccountActions.select(accountId))},
onFetchTransactionPage: function(account, pageSize, page) {dispatch(TransactionActions.fetchPage(account, pageSize, page))},
}
}
module.exports = connect(
mapStateToProps,
mapDispatchToProps
)(MoneyGoApp)