mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
commit
62585d9a06
3 changed files with 90 additions and 82 deletions
|
@ -100,7 +100,7 @@
|
|||
"redux": "3.5.2",
|
||||
"redux-thunk": "2.0.1",
|
||||
"sass-loader": "6.0.6",
|
||||
"scratch-gui": "0.1.0-prerelease.20190102131553",
|
||||
"scratch-gui": "0.1.0-prerelease.20190103214909",
|
||||
"scratch-l10n": "latest",
|
||||
"scratchr2_translations": "git://github.com/LLK/scratchr2_translations.git#master",
|
||||
"slick-carousel": "1.6.0",
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-family: "Helvetica Neue";
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: .875rem;
|
||||
font-weight: regular;
|
||||
flex-shrink: 1;
|
||||
|
|
|
@ -123,6 +123,10 @@ const PreviewPresentation = ({
|
|||
}) => {
|
||||
const shareDate = ((projectInfo.history && projectInfo.history.shared)) ? projectInfo.history.shared : '';
|
||||
const revisedDate = ((projectInfo.history && projectInfo.history.modified)) ? projectInfo.history.modified : '';
|
||||
const showInstructions = editable || projectInfo.instructions ||
|
||||
(!projectInfo.instructions && !projectInfo.description); // show if both are empty
|
||||
const showNotesAndCredits = editable || projectInfo.description ||
|
||||
(!projectInfo.instructions && !projectInfo.description); // show if both are empty
|
||||
|
||||
// Allow embedding html in banner messages coming from the server
|
||||
const embedCensorMessage = message => (
|
||||
|
@ -348,89 +352,93 @@ const PreviewPresentation = ({
|
|||
</FlexRow>
|
||||
</FlexRow>
|
||||
</MediaQuery>
|
||||
<div className="description-block">
|
||||
<div className="project-textlabel">
|
||||
<FormattedMessage id="project.instructionsLabel" />
|
||||
</div>
|
||||
{editable ?
|
||||
<Formsy
|
||||
className="project-description-form"
|
||||
onKeyPress={onKeyPress}
|
||||
>
|
||||
<InplaceInput
|
||||
className={classNames(
|
||||
'project-description-edit',
|
||||
{remixes: parentInfo && parentInfo.author}
|
||||
)}
|
||||
handleUpdate={onUpdate}
|
||||
name="instructions"
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'project.descriptionPlaceholder'
|
||||
})}
|
||||
type="textarea"
|
||||
validationErrors={{
|
||||
maxLength: intl.formatMessage({
|
||||
id: 'project.descriptionMaxLength'
|
||||
})
|
||||
}}
|
||||
validations={{
|
||||
// TODO: actual 5000
|
||||
maxLength: 1000
|
||||
}}
|
||||
value={projectInfo.instructions}
|
||||
/>
|
||||
</Formsy> :
|
||||
<div className="project-description">
|
||||
{decorateText(projectInfo.instructions, {
|
||||
usernames: true,
|
||||
hashtags: true,
|
||||
scratchLinks: false
|
||||
})}
|
||||
{showInstructions && (
|
||||
<div className="description-block">
|
||||
<div className="project-textlabel">
|
||||
<FormattedMessage id="project.instructionsLabel" />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div className="description-block">
|
||||
<div className="project-textlabel">
|
||||
<FormattedMessage id="project.notesAndCreditsLabel" />
|
||||
</div>
|
||||
{editable ?
|
||||
<Formsy
|
||||
className="project-description-form"
|
||||
onKeyPress={onKeyPress}
|
||||
>
|
||||
<InplaceInput
|
||||
className={classNames(
|
||||
'project-description-edit',
|
||||
'last',
|
||||
{remixes: parentInfo && parentInfo.author}
|
||||
)}
|
||||
handleUpdate={onUpdate}
|
||||
name="description"
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'project.notesPlaceholder'
|
||||
{editable ?
|
||||
<Formsy
|
||||
className="project-description-form"
|
||||
onKeyPress={onKeyPress}
|
||||
>
|
||||
<InplaceInput
|
||||
className={classNames(
|
||||
'project-description-edit',
|
||||
{remixes: parentInfo && parentInfo.author}
|
||||
)}
|
||||
handleUpdate={onUpdate}
|
||||
name="instructions"
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'project.descriptionPlaceholder'
|
||||
})}
|
||||
type="textarea"
|
||||
validationErrors={{
|
||||
maxLength: intl.formatMessage({
|
||||
id: 'project.descriptionMaxLength'
|
||||
})
|
||||
}}
|
||||
validations={{
|
||||
// TODO: actual 5000
|
||||
maxLength: 1000
|
||||
}}
|
||||
value={projectInfo.instructions}
|
||||
/>
|
||||
</Formsy> :
|
||||
<div className="project-description">
|
||||
{decorateText(projectInfo.instructions, {
|
||||
usernames: true,
|
||||
hashtags: true,
|
||||
scratchLinks: false
|
||||
})}
|
||||
type="textarea"
|
||||
validationErrors={{
|
||||
maxLength: intl.formatMessage({
|
||||
id: 'project.descriptionMaxLength'
|
||||
})
|
||||
}}
|
||||
validations={{
|
||||
// TODO: actual 5000
|
||||
maxLength: 1000
|
||||
}}
|
||||
value={projectInfo.description}
|
||||
/>
|
||||
</Formsy> :
|
||||
<div className="project-description last">
|
||||
{decorateText(projectInfo.description, {
|
||||
usernames: true,
|
||||
hashtags: true,
|
||||
scratchLinks: false
|
||||
})}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
)}
|
||||
{showNotesAndCredits && (
|
||||
<div className="description-block">
|
||||
<div className="project-textlabel">
|
||||
<FormattedMessage id="project.notesAndCreditsLabel" />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
{editable ?
|
||||
<Formsy
|
||||
className="project-description-form"
|
||||
onKeyPress={onKeyPress}
|
||||
>
|
||||
<InplaceInput
|
||||
className={classNames(
|
||||
'project-description-edit',
|
||||
'last',
|
||||
{remixes: parentInfo && parentInfo.author}
|
||||
)}
|
||||
handleUpdate={onUpdate}
|
||||
name="description"
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'project.notesPlaceholder'
|
||||
})}
|
||||
type="textarea"
|
||||
validationErrors={{
|
||||
maxLength: intl.formatMessage({
|
||||
id: 'project.descriptionMaxLength'
|
||||
})
|
||||
}}
|
||||
validations={{
|
||||
// TODO: actual 5000
|
||||
maxLength: 1000
|
||||
}}
|
||||
value={projectInfo.description}
|
||||
/>
|
||||
</Formsy> :
|
||||
<div className="project-description last">
|
||||
{decorateText(projectInfo.description, {
|
||||
usernames: true,
|
||||
hashtags: true,
|
||||
scratchLinks: false
|
||||
})}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
)}
|
||||
{/* eslint-enable max-len */}
|
||||
</FlexRow>
|
||||
</FlexRow>
|
||||
|
|
Loading…
Reference in a new issue