🔥 ⚡ Major Update
* Adds Actions, Redicers and Middlewares * Adds Http Service * Adds Cancel option for Http Service * Adds HOC's for API Loader, Sidebar and Headers * Adds Random key generator for Routes
This commit is contained in:
36
src/shared/sidebar.hoc.js
Normal file
36
src/shared/sidebar.hoc.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import React, { Component } from "react";
|
||||
import { Link } from 'react-router-dom';
|
||||
import { connect } from "react-redux";
|
||||
import { compose } from "redux";
|
||||
import './sidebar.css';
|
||||
|
||||
const Sidebar = (HocComponent) => {
|
||||
return class SidebarComponent extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="sidebar">
|
||||
Sidebar
|
||||
</div>
|
||||
<div className="content">
|
||||
<HocComponent {...this.props} />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
const WithSidebar = compose(
|
||||
connect(mapStateToProps, null),
|
||||
Sidebar
|
||||
)
|
||||
export default WithSidebar;
|
||||
Reference in New Issue
Block a user