feat(Navigation): Enhance navigation with addons

Use the withExtras HOC to add external functionality without embedding that knowledge in the core.
This commit is contained in:
Adrian Oprea 2018-01-16 17:24:11 +02:00
parent d7b63f5941
commit d71f6161e4

View file

@ -16,6 +16,10 @@ import SearchDropdown from "./components/SearchDropdown";
import NotificationsDropdown from "./components/NotificationsDropdown";
import InfoDropdown from "./components/InfoDropdown";
import UserAccountDropdown from "./components/UserAccountDropdown";
import withExtras from 'react-hijack';
import addonsConfig from '../../componentLoader/config';
import massageConfiguration from '../../componentLoader/massageConfiguration';
import componentLoader from '../../componentLoader';
const StyledNavbar = styled(Navbar)`
background-color: ${WHITE_COLOR};
@ -75,7 +79,7 @@ class Navigation extends Component {
render() {
return (
<div>
<div id="mountPoint">
<StyledNavbar onSelect={this.selectItemCallback}>
<Navbar.Header>
<Navbar.Brand>
@ -148,4 +152,9 @@ Navigation.propTypes = {
// Map the states from store to component props
const mapStateToProps = ({ current_team }) => ({ current_team });
export default connect(mapStateToProps)(Navigation);
const NavigationWithExtras = withExtras({
screenName: 'navigation',
config: massageConfiguration(addonsConfig, 'navigation'),
}, componentLoader)(Navigation);
export default connect(mapStateToProps)(NavigationWithExtras);