mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 15:47:53 -05:00
share date is passed as a prop to subactions
This commit is contained in:
parent
79afc55f26
commit
8db5216f17
2 changed files with 295 additions and 296 deletions
|
@ -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,
|
||||
|
|
|
@ -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">©</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
|
||||
|
||||
|
|
Loading…
Reference in a new issue