share date is passed as a prop to subactions

This commit is contained in:
Linda 2018-10-05 09:15:09 -04:00
parent 79afc55f26
commit 8db5216f17
2 changed files with 295 additions and 296 deletions

View file

@ -76,7 +76,9 @@ const PreviewPresentation = ({
onToggleStudio,
onSeeInside,
onUpdate
}) => (
}) => {
const shareDate = ((projectInfo.history && projectInfo.history.shared)) ? projectInfo.history.shared : '';
return (
<div className="preview">
<ShareBanner shared={isShared} />
{ projectInfo && projectInfo.author && projectInfo.author.id && (
@ -166,6 +168,7 @@ const PreviewPresentation = ({
isLoggedIn={isLoggedIn}
projectInfo={projectInfo}
reportOpen={reportOpen}
shareDate={shareDate}
studios={studios}
userOwnsProject={userOwnsProject}
onAddToStudioClicked={onAddToStudioClicked}
@ -278,6 +281,7 @@ const PreviewPresentation = ({
isLoggedIn={isLoggedIn}
projectInfo={projectInfo}
reportOpen={reportOpen}
shareDate={shareDate}
studios={studios}
userOwnsProject={userOwnsProject}
onAddToStudioClicked={onAddToStudioClicked}
@ -350,6 +354,7 @@ const PreviewPresentation = ({
)}
</div>
);
};
PreviewPresentation.propTypes = {
addToStudioOpen: PropTypes.bool,

View file

@ -7,23 +7,18 @@ 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 (
const Subactions = props => (
<FlexRow className="subactions">
<div className="share-date">
<div className="copyleft">&copy;</div>
{' '}
{/* eslint-disable react/jsx-sort-props */}
{shareDate === null ?
{props.shareDate === null ?
'Unshared' :
<FormattedDate
value={Date.parse(shareDate)}
value={Date.parse(props.shareDate)}
day="2-digit"
month="short"
year="numeric"
@ -74,7 +69,6 @@ const Subactions = props => {
</FlexRow>
</FlexRow>
);
};
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