const FormattedDate = require('react-intl').FormattedDate; const injectIntl = require('react-intl').injectIntl; const PropTypes = require('prop-types'); const intlShape = require('react-intl').intlShape; const React = require('react'); const Formsy = require('formsy-react').default; const classNames = require('classnames'); const approx = require('approximate-number'); const GUI = require('scratch-gui').default; const IntlGUI = injectIntl(GUI); const decorateText = require('../../lib/decorate-text.jsx'); const FlexRow = require('../../components/flex-row/flex-row.jsx'); const Button = require('../../components/forms/button.jsx'); const Avatar = require('../../components/avatar/avatar.jsx'); const CappedNumber = require('../../components/cappednumber/cappednumber.jsx'); const ShareBanner = require('./share-banner.jsx'); const RemixCredit = require('./remix-credit.jsx'); const RemixList = require('./remix-list.jsx'); const StudioList = require('./studio-list.jsx'); const InplaceInput = require('../../components/forms/inplace-input.jsx'); const AddToStudioModal = require('../../components/modal/addtostudio/container.jsx'); const ReportModal = require('../../components/modal/report/modal.jsx'); const TopLevelComment = require('./comment/top-level-comment.jsx'); const ExtensionChip = require('./extension-chip.jsx'); const projectShape = require('./projectshape.jsx').projectShape; require('./preview.scss'); // disable enter key submission on formsy input fields; otherwise formsy thinks // we meant to trigger the "See inside" button. Instead, treat these keypresses // as a blur, which will trigger a save. const onKeyPress = e => { if (e.target.type === 'text' && e.which === 13 /* Enter */) { e.preventDefault(); e.target.blur(); } }; const PreviewPresentation = ({ assetHost, backpackOptions, comments, editable, extensions, faved, favoriteCount, intl, isFullScreen, isLoggedIn, isShared, loved, loveCount, originalInfo, parentInfo, projectHost, projectId, projectInfo, remixes, reportOpen, replies, addToStudioOpen, projectStudios, studios, userOwnsProject, onFavoriteClicked, onLoadMore, onLoveClicked, onReportClicked, onReportClose, onReportSubmit, onAddToStudioClicked, onAddToStudioClosed, onToggleStudio, onSeeInside, onUpdate }) => { const shareDate = ((projectInfo.history && projectInfo.history.shared)) ? projectInfo.history.shared : ''; return (