You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
485 B
22 lines
485 B
4 years ago
|
import { connect } from 'react-redux';
|
||
|
import { hideModal } from '../../../store/actions';
|
||
6 years ago
|
|
||
5 years ago
|
const mapStateToProps = (state) => {
|
||
4 years ago
|
const { appState } = state;
|
||
|
const { props: modalProps } = appState.modal.modalState;
|
||
6 years ago
|
|
||
|
return {
|
||
|
...modalProps,
|
||
4 years ago
|
};
|
||
|
};
|
||
6 years ago
|
|
||
5 years ago
|
const mapDispatchToProps = (dispatch) => {
|
||
6 years ago
|
return {
|
||
|
hideModal: () => dispatch(hideModal()),
|
||
4 years ago
|
};
|
||
|
};
|
||
6 years ago
|
|
||
4 years ago
|
export default function withModalProps(Component) {
|
||
4 years ago
|
return connect(mapStateToProps, mapDispatchToProps)(Component);
|
||
6 years ago
|
}
|