do not show channel info for home channels

This commit is contained in:
Travis Eden 2018-10-11 13:00:23 -04:00
parent 418dda62d6
commit ba49aff9c5
2 changed files with 15 additions and 12 deletions

View file

@ -1,19 +1,20 @@
import { connect } from 'react-redux';
import View from './view';
const mapStateToProps = ({ show }) => {
const mapStateToProps = ({ show, site, channel }) => {
// select request info
const requestId = show.request.id;
// select request
const previousRequest = show.requestList[requestId] || null;
// select channel
let channel;
let thisChannel;
if (previousRequest) {
const channelKey = previousRequest.key;
channel = show.channelList[channelKey] || null;
thisChannel = show.channelList[channelKey] || null;
}
return {
channel,
channel : thisChannel,
homeChannel: site.publishOnlyApproved && !channel.loggedInChannel.name ? `${site.approvedChannels[0].name}:${site.approvedChannels[0].longId}` : null,
};
};

View file

@ -7,7 +7,7 @@ import Row from '@components/Row';
class ShowChannel extends React.Component {
render () {
const { channel } = this.props;
const { channel, homeChannel } = this.props;
if (channel) {
const { name, longId, shortId } = channel;
return (
@ -15,13 +15,15 @@ class ShowChannel extends React.Component {
pageTitle={name}
channel={channel}
>
<Row>
<ChannelInfoDisplay
name={name}
longId={longId}
shortId={shortId}
/>
</Row>
{!homeChannel && (
<Row>
<ChannelInfoDisplay
name={name}
longId={longId}
shortId={shortId}
/>
</Row>
)}
<ChannelClaimsDisplay />
</PageLayout>
);