mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
Fix : Preferences
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
getCurrencyById,
|
||||
getCurrencyByCode,
|
||||
} from 'store/currencies/currencies.selector';
|
||||
|
||||
|
||||
const mapStateToProps = (state, props) => ({
|
||||
...(props.currencyId) ? {
|
||||
currency: getCurrencyById(state.currencies.data, props.currencyId),
|
||||
} : (props.currencyCode) ? {
|
||||
currency: getCurrencyByCode(state.currencies.data, props.currencyCode),
|
||||
} : {},
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps);
|
||||
12
client/src/containers/Currencies/withCurrencyDetail.js
Normal file
12
client/src/containers/Currencies/withCurrencyDetail.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
getCurrencyById,
|
||||
getCurrencyByCode,
|
||||
} from 'store/currencies/currencies.selector';
|
||||
|
||||
const mapStateToProps = (state, props) => ({
|
||||
currency: getCurrencyByCode(state, props),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps);
|
||||
|
||||
Reference in New Issue
Block a user