mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
WIP
This commit is contained in:
22
client/src/components/DialogReduxConnect.js
Normal file
22
client/src/components/DialogReduxConnect.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
export default (Dialog) => {
|
||||
|
||||
function DialogReduxConnect(props) {
|
||||
return (<Dialog {...props} />);
|
||||
};
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
const dialogs = state.dashboard.dialogs;
|
||||
|
||||
if (dialogs && dialogs.hasOwnProperty['name'] && dialogs[props.name]) {
|
||||
const { isOpen, payload } = dialogs[props.name];
|
||||
return { isOpen, payload };
|
||||
}
|
||||
};
|
||||
|
||||
return connect(
|
||||
mapStateToProps,
|
||||
)(DialogReduxConnect);
|
||||
}
|
||||
Reference in New Issue
Block a user