diff --git a/client/src/containers/NavigationLinks/index.jsx b/client/src/containers/NavigationLinks/index.jsx index 7ef8ff85..d5a9c454 100644 --- a/client/src/containers/NavigationLinks/index.jsx +++ b/client/src/containers/NavigationLinks/index.jsx @@ -1,13 +1,15 @@ import { connect } from 'react-redux'; import { logOutChannel, checkForLoggedInChannel } from '../../actions/channel'; +import isApprovedChannel from '../../../../utils/isApprovedChannel'; import View from './view'; const mapStateToProps = ({ site, channel: { loggedInChannel: { name, shortId, longId } } }) => { return { - site, - channelName : name, - channelShortId: shortId, - channelLongId : longId, + showPublish : (!site.publishOnlyApproved || isApprovedChannel({ longId }, site.approvedChannels)), + closedRegistration: site.closedRegistration, + channelName : name, + channelShortId : shortId, + channelLongId : longId, }; }; diff --git a/client/src/containers/NavigationLinks/view.jsx b/client/src/containers/NavigationLinks/view.jsx index c1a71335..01775688 100644 --- a/client/src/containers/NavigationLinks/view.jsx +++ b/client/src/containers/NavigationLinks/view.jsx @@ -1,7 +1,6 @@ import React from 'react'; import { NavLink, withRouter } from 'react-router-dom'; import NavBarChannelOptionsDropdown from '@components/NavBarChannelOptionsDropdown'; -import isApprovedChannel from '../../../../utils/isApprovedChannel'; const VIEW = 'VIEW'; const LOGOUT = 'LOGOUT'; @@ -29,10 +28,10 @@ class NavigationLinks extends React.Component { } } render () { - const { site, channelLongId, channelName } = this.props; + const { channelName, showPublish, closedRegistration } = this.props; return (