diff --git a/src/components/import-error/import-error.jsx b/src/components/import-error/import-error.jsx index 5147138a6..bc8f287ea 100644 --- a/src/components/import-error/import-error.jsx +++ b/src/components/import-error/import-error.jsx @@ -1,12 +1,15 @@ import bindAll from 'lodash.bindall'; import classNames from 'classnames'; -import {defineMessages, injectIntl, intlShape, FormattedMessage} from 'react-intl'; +import {/* defineMessages, */injectIntl/* , intlShape, FormattedMessage*/} from 'react-intl'; import PropTypes from 'prop-types'; import React from 'react'; import ReactTooltip from 'react-tooltip'; import styles from './import-error.css'; +// TODO store different error messages depending on the situation (?) and +// needs to use intl lib for localization support + class ImportErrorContent extends React.Component { constructor (props) { super(props); @@ -56,10 +59,11 @@ class ImportErrorContent extends React.Component { ImportErrorContent.propTypes = { className: PropTypes.string, - intl: intlShape, + errorMessage: PropTypes.string.isRequired, + // intl: intlShape, place: PropTypes.oneOf(['top', 'right', 'bottom', 'left']), - tooltipId: PropTypes.string.isRequired, - errorMessage: PropTypes.string.isRequired + tooltipId: PropTypes.string.isRequired + }; ImportErrorContent.defaultProps = { @@ -82,9 +86,9 @@ const ImportErrorTooltip = props => ( ); @@ -94,10 +98,11 @@ ImportErrorTooltip.propTypes = { className: PropTypes.string, delayHide: PropTypes.number, delayShow: PropTypes.number, + errorMessage: PropTypes.string.isRequired, place: PropTypes.oneOf(['top', 'right', 'bottom', 'left']), tooltipClassName: PropTypes.string, - tooltipId: PropTypes.string.isRequired, - errorMessage: PropTypes.string.isRequired + tooltipId: PropTypes.string.isRequired + }; ImportErrorTooltip.defaultProps = { diff --git a/src/components/import-input/import-input.jsx b/src/components/import-input/import-input.jsx index 997de86af..bc4d7c0c2 100644 --- a/src/components/import-input/import-input.jsx +++ b/src/components/import-input/import-input.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import classNames from 'classnames'; +// import classNames from 'classnames'; import {ImportErrorTooltip} from '../import-error/import-error.jsx'; @@ -8,50 +8,50 @@ import {ImportErrorTooltip} from '../import-error/import-error.jsx'; class ImportInput extends React.Component { render () { let input = null; - if (!this.props.hasValidationError) { - input = ( - - ); - } else { + if (this.props.hasValidationError) { input = ( ); + } else { + input = ( + + ); } return input; } } ImportInput.propTypes = { - onChange: PropTypes.func.isRequired, - onKeyPress: PropTypes.func.isRequired, - placeholder: PropTypes.string, + badClassName: PropTypes.string, + errorDivClassName: PropTypes.string, errorMessage: PropTypes.string.isRequired, hasValidationError: PropTypes.bool.isRequired, inputValue: PropTypes.string.isRequired, okClassName: PropTypes.string, - badClassName: PropTypes.string, - errorDivClassName: PropTypes.string + onChange: PropTypes.func.isRequired, + onKeyPress: PropTypes.func.isRequired, + placeholder: PropTypes.string }; export default ImportInput; diff --git a/src/components/import-modal/import-modal.jsx b/src/components/import-modal/import-modal.jsx index 9df475f12..03a1aef8f 100644 --- a/src/components/import-modal/import-modal.jsx +++ b/src/components/import-modal/import-modal.jsx @@ -15,6 +15,12 @@ const messages = defineMessages({ id: 'gui.importInfo.title', defaultMessage: 'View a Scratch 2.0 Project', description: 'Scratch 2.0 import modal label - for accessibility' + }, + formDescription: { + defaultMessage: + 'Enter a link to one of your shared Scratch projects. Changes made in this 3.0 Preview will not be saved.', + description: 'Import project message', + id: 'gui.importInfo.message' } }); @@ -57,24 +63,20 @@ const ImportModal = ({intl, ...props}) => (

- + {intl.formatMessage({...messages.formDescription})}