mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
efb35b537a
* add prettier and have it format all js code except website: : * trying running prettier check in CI * fix runs on in CI * change CI job name * fix prettier erros and fix CI
38 lines
770 B
JavaScript
38 lines
770 B
JavaScript
import React, { Component } from "react";
|
|
import PropTypes from "prop-types";
|
|
import { connect } from "react-redux";
|
|
import { noop } from "lodash";
|
|
|
|
import {
|
|
removeRightSidePanel,
|
|
showRightSidePanel,
|
|
} from "redux/nodes/app/actions";
|
|
|
|
const ShowSidePanel = (WrappedComponent) => {
|
|
class PageWithSidePanel extends Component {
|
|
static propTypes = {
|
|
dispatch: PropTypes.func,
|
|
};
|
|
|
|
static defaultProps = {
|
|
dispatch: noop,
|
|
};
|
|
|
|
componentWillMount() {
|
|
this.props.dispatch(showRightSidePanel);
|
|
}
|
|
|
|
componentWillUnmount() {
|
|
this.props.dispatch(removeRightSidePanel);
|
|
}
|
|
|
|
render() {
|
|
return <WrappedComponent {...this.props} />;
|
|
}
|
|
}
|
|
|
|
return connect()(PageWithSidePanel);
|
|
};
|
|
|
|
export default ShowSidePanel;
|