From 8db5216f17f0dd2e29a666c9f483cc33b72bff7d Mon Sep 17 00:00:00 2001 From: Linda Date: Fri, 5 Oct 2018 09:15:09 -0400 Subject: [PATCH] share date is passed as a prop to subactions --- src/views/preview/presentation.jsx | 477 +++++++++++++++-------------- src/views/preview/subactions.jsx | 114 ++++--- 2 files changed, 295 insertions(+), 296 deletions(-) diff --git a/src/views/preview/presentation.jsx b/src/views/preview/presentation.jsx index 85918defa..ee3dbab5a 100644 --- a/src/views/preview/presentation.jsx +++ b/src/views/preview/presentation.jsx @@ -76,82 +76,197 @@ const PreviewPresentation = ({ onToggleStudio, onSeeInside, onUpdate -}) => ( -
- - { projectInfo && projectInfo.author && projectInfo.author.id && ( - -
- - - - - -
- {editable ? - : - -
{projectInfo.title}
- {'by '} - - {projectInfo.author.username} - -
- } -
-
- -
- {/* TODO: Hide Remix button for now until implemented */} - {(!userOwnsProject && false) && - + } + - } - +
+
+
+ +
+
- -
- -
- -
- - + + + + + + + + + + {/* eslint-disable max-len */} + + + + {extensions && extensions.map(extension => ( + + ))} + + + + +
+ Instructions +
+ {editable ? + : +
+ {decorateText(projectInfo.instructions)} +
+ } +
+ +
+ Notes and Credits +
+ {editable ? + : +
+ {decorateText(projectInfo.description)} +
+ } +
+ {/* eslint-enable max-len */} +
+
+ + - - - - {/* eslint-disable max-len */} - - - - {extensions && extensions.map(extension => ( - - ))} - - - - -
- Instructions -
- {editable ? - : -
- {decorateText(projectInfo.instructions)} -
- } -
- -
- Notes and Credits -
- {editable ? - : -
- {decorateText(projectInfo.description)} -
- } -
- {/* eslint-enable max-len */} -
-
- - - - - - - - - - {extensions && extensions.map(extension => ( - - ))} - - - -
-
-
- -
- -

Comments

- {/* TODO: Add toggle comments component and logic*/} -
- - {comments.map(comment => ( - + + + {extensions && extensions.map(extension => ( + ))} - {comments.length < projectInfo.stats.comments && + + + +
+
+
+ +
+ +

Comments

+ {/* TODO: Add toggle comments component and logic*/} +
+ + {comments.map(comment => ( + + ))} + {comments.length < projectInfo.stats.comments && - } + } + +
+ + + -
- - - - +
-
-
- )} -
-); + + )} + + ); +}; PreviewPresentation.propTypes = { addToStudioOpen: PropTypes.bool, diff --git a/src/views/preview/subactions.jsx b/src/views/preview/subactions.jsx index 145703883..15acbb27b 100644 --- a/src/views/preview/subactions.jsx +++ b/src/views/preview/subactions.jsx @@ -7,74 +7,68 @@ const Button = require('../../components/forms/button.jsx'); const AddToStudioModal = require('../../components/modal/addtostudio/container.jsx'); const ReportModal = require('../../components/modal/report/modal.jsx'); -const projectShape = require('./projectshape.jsx').projectShape; - require('./subactions.scss'); -const Subactions = props => { - const shareDate = ((props.projectInfo.history && props.projectInfo.history.shared)) ? - props.projectInfo.history.shared : ''; - return ( - -
-
©
- {' '} - {/* eslint-disable react/jsx-sort-props */} - {shareDate === null ? - 'Unshared' : - - } - {/* eslint-enable react/jsx-sort-props */} -
- - {(props.isLoggedIn && props.userOwnsProject) && - - , - - - } - - {(props.isLoggedIn && !props.userOwnsProject) && +const Subactions = props => ( + +
+
©
+ {' '} + {/* eslint-disable react/jsx-sort-props */} + {props.shareDate === null ? + 'Unshared' : + + } + {/* eslint-enable react/jsx-sort-props */} +
+ + {(props.isLoggedIn && props.userOwnsProject) && , - - } - + } + + {(props.isLoggedIn && !props.userOwnsProject) && + + , + + + }
- ); -}; +
+); Subactions.propTypes = { addToStudioOpen: PropTypes.bool, @@ -85,8 +79,8 @@ Subactions.propTypes = { onReportClose: PropTypes.func.isRequired, onReportSubmit: PropTypes.func.isRequired, onToggleStudio: PropTypes.func, - projectInfo: projectShape, reportOpen: PropTypes.bool, + shareDate: PropTypes.string, studios: PropTypes.arrayOf(PropTypes.object), userOwnsProject: PropTypes.bool