mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
WIP / exchangeRate / localize
This commit is contained in:
31
client/src/connectors/ExchangeRatesFromDialog.connect.js
Normal file
31
client/src/connectors/ExchangeRatesFromDialog.connect.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { compose } from 'utils';
|
||||
import DialogConnect from 'connectors/Dialog.connector';
|
||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||
import withExchangeRatesActions from 'containers/FinancialStatements/ExchangeRates/withExchangeRatesActions';
|
||||
import withExchangeRates from 'containers/FinancialStatements/ExchangeRates/withExchangeRates';
|
||||
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
||||
import CurrencyFromDialogConnect from 'connectors/CurrencyFromDialog.connect';
|
||||
|
||||
export const mapStateToProps = (state, props) => {
|
||||
const dialogPayload = getDialogPayload(state, 'exchangeRate-form');
|
||||
|
||||
return {
|
||||
exchangeRatesList: Object.values(state.exchangeRates.exchangeRates),
|
||||
name: 'exchangeRate-form',
|
||||
payload: { action: 'new', id: null, ...dialogPayload },
|
||||
editExchangeRate:
|
||||
dialogPayload && dialogPayload.action === 'edit'
|
||||
? state.exchangeRates.exchangeRates[dialogPayload.id]
|
||||
: {},
|
||||
};
|
||||
};
|
||||
const ExchangeRatesDialogConnect = connect(mapStateToProps);
|
||||
export default compose(
|
||||
CurrencyFromDialogConnect,
|
||||
ExchangeRatesDialogConnect,
|
||||
withExchangeRatesActions,
|
||||
withExchangeRates,
|
||||
DialogReduxConnect,
|
||||
DialogConnect
|
||||
);
|
||||
Reference in New Issue
Block a user