Osprey landing page and styling #632
2 changed files with 15 additions and 12 deletions
|
@ -1,19 +1,20 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import View from './view';
|
import View from './view';
|
||||||
|
|
||||||
const mapStateToProps = ({ show }) => {
|
const mapStateToProps = ({ show, site, channel }) => {
|
||||||
// select request info
|
// select request info
|
||||||
const requestId = show.request.id;
|
const requestId = show.request.id;
|
||||||
// select request
|
// select request
|
||||||
const previousRequest = show.requestList[requestId] || null;
|
const previousRequest = show.requestList[requestId] || null;
|
||||||
// select channel
|
// select channel
|
||||||
let channel;
|
let thisChannel;
|
||||||
if (previousRequest) {
|
if (previousRequest) {
|
||||||
const channelKey = previousRequest.key;
|
const channelKey = previousRequest.key;
|
||||||
channel = show.channelList[channelKey] || null;
|
thisChannel = show.channelList[channelKey] || null;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
channel,
|
channel : thisChannel,
|
||||||
|
homeChannel: site.publishOnlyApproved && !channel.loggedInChannel.name ? `${site.approvedChannels[0].name}:${site.approvedChannels[0].longId}` : null,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import Row from '@components/Row';
|
||||||
|
|
||||||
class ShowChannel extends React.Component {
|
class ShowChannel extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
const { channel } = this.props;
|
const { channel, homeChannel } = this.props;
|
||||||
if (channel) {
|
if (channel) {
|
||||||
const { name, longId, shortId } = channel;
|
const { name, longId, shortId } = channel;
|
||||||
return (
|
return (
|
||||||
|
@ -15,13 +15,15 @@ class ShowChannel extends React.Component {
|
||||||
pageTitle={name}
|
pageTitle={name}
|
||||||
channel={channel}
|
channel={channel}
|
||||||
>
|
>
|
||||||
<Row>
|
{!homeChannel && (
|
||||||
<ChannelInfoDisplay
|
<Row>
|
||||||
name={name}
|
<ChannelInfoDisplay
|
||||||
longId={longId}
|
name={name}
|
||||||
shortId={shortId}
|
longId={longId}
|
||||||
/>
|
shortId={shortId}
|
||||||
</Row>
|
/>
|
||||||
|
</Row>
|
||||||
|
)}
|
||||||
<ChannelClaimsDisplay />
|
<ChannelClaimsDisplay />
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue