Show projectNotAvailable view in editor mode also

This commit is contained in:
Paul Kaplan 2018-11-19 14:16:56 -05:00
parent 4f4a59875a
commit 7cfc3ed846
2 changed files with 11 additions and 12 deletions

View file

@ -25,7 +25,6 @@ const InplaceInput = require('../../components/forms/inplace-input.jsx');
const TopLevelComment = require('./comment/top-level-comment.jsx'); const TopLevelComment = require('./comment/top-level-comment.jsx');
const ComposeComment = require('./comment/compose-comment.jsx'); const ComposeComment = require('./comment/compose-comment.jsx');
const ExtensionChip = require('./extension-chip.jsx'); const ExtensionChip = require('./extension-chip.jsx');
const NotAvailable = require('../../components/not-available/not-available.jsx');
const projectShape = require('./projectshape.jsx').projectShape; const projectShape = require('./projectshape.jsx').projectShape;
require('./preview.scss'); require('./preview.scss');
@ -90,7 +89,6 @@ const PreviewPresentation = ({
projectHost, projectHost,
projectId, projectId,
projectInfo, projectInfo,
projectNotAvailable,
projectStudios, projectStudios,
remixes, remixes,
replies, replies,
@ -100,14 +98,6 @@ const PreviewPresentation = ({
}) => { }) => {
const shareDate = ((projectInfo.history && projectInfo.history.shared)) ? projectInfo.history.shared : ''; const shareDate = ((projectInfo.history && projectInfo.history.shared)) ? projectInfo.history.shared : '';
if (projectNotAvailable) {
return (
<div className="preview">
<NotAvailable />
</div>
);
}
return ( return (
<div className="preview"> <div className="preview">
{canShare && !isShared && ( {canShare && !isShared && (
@ -498,7 +488,6 @@ PreviewPresentation.propTypes = {
projectHost: PropTypes.string, projectHost: PropTypes.string,
projectId: PropTypes.string, projectId: PropTypes.string,
projectInfo: projectShape, projectInfo: projectShape,
projectNotAvailable: PropTypes.bool,
projectStudios: PropTypes.arrayOf(PropTypes.object), projectStudios: PropTypes.arrayOf(PropTypes.object),
remixes: PropTypes.arrayOf(PropTypes.object), remixes: PropTypes.arrayOf(PropTypes.object),
replies: PropTypes.objectOf(PropTypes.array), replies: PropTypes.objectOf(PropTypes.array),

View file

@ -20,6 +20,7 @@ const projectShape = require('./projectshape.jsx').projectShape;
const Registration = require('../../components/registration/registration.jsx'); const Registration = require('../../components/registration/registration.jsx');
const ConnectedLogin = require('../../components/login/connected-login.jsx'); const ConnectedLogin = require('../../components/login/connected-login.jsx');
const CanceledDeletionModal = require('../../components/login/canceled-deletion-modal.jsx'); const CanceledDeletionModal = require('../../components/login/canceled-deletion-modal.jsx');
const NotAvailable = require('../../components/not-available/not-available.jsx');
const sessionActions = require('../../redux/session.js'); const sessionActions = require('../../redux/session.js');
const navigationActions = require('../../redux/navigation.js'); const navigationActions = require('../../redux/navigation.js');
@ -400,6 +401,16 @@ class Preview extends React.Component {
); );
} }
render () { render () {
if (this.props.projectNotAvailable) {
return (
<Page>
<div className="preview">
<NotAvailable />
</div>
</Page>
);
}
return ( return (
this.props.playerMode ? this.props.playerMode ?
<Page> <Page>
@ -431,7 +442,6 @@ class Preview extends React.Component {
projectHost={this.props.projectHost} projectHost={this.props.projectHost}
projectId={this.state.projectId} projectId={this.state.projectId}
projectInfo={this.props.projectInfo} projectInfo={this.props.projectInfo}
projectNotAvailable={this.props.projectNotAvailable}
projectStudios={this.props.projectStudios} projectStudios={this.props.projectStudios}
remixes={this.props.remixes} remixes={this.props.remixes}
replies={this.props.replies} replies={this.props.replies}