mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
pass createProjectOnComplete prop through join flow
…so welcome step can display correct completion text
This commit is contained in:
parent
465a87d453
commit
691faabe28
5 changed files with 15 additions and 5 deletions
|
@ -155,6 +155,7 @@ class JoinFlow extends React.Component {
|
|||
onRegistrationError={this.handleRegistrationError}
|
||||
/>
|
||||
<WelcomeStep
|
||||
createProjectOnComplete={this.props.createProjectOnComplete}
|
||||
email={this.state.formData.email}
|
||||
username={this.state.formData.username}
|
||||
onNextStep={this.props.onCompleteRegistration}
|
||||
|
@ -167,6 +168,7 @@ class JoinFlow extends React.Component {
|
|||
}
|
||||
|
||||
JoinFlow.propTypes = {
|
||||
createProjectOnComplete: PropTypes.bool,
|
||||
intl: intlShape,
|
||||
onCompleteRegistration: PropTypes.func,
|
||||
refreshSession: PropTypes.func
|
||||
|
|
|
@ -45,7 +45,7 @@ class WelcomeStep extends React.Component {
|
|||
descriptionClassName="join-flow-welcome-description"
|
||||
headerImgSrc="/images/join-flow/welcome-header.png"
|
||||
innerClassName="join-flow-inner-welcome-step"
|
||||
nextButton={
|
||||
nextButton={this.props.createProjectOnComplete ? (
|
||||
<React.Fragment>
|
||||
<FormattedMessage id="registration.makeProject" />
|
||||
<img
|
||||
|
@ -53,7 +53,9 @@ class WelcomeStep extends React.Component {
|
|||
src="/svgs/project/r-arrow.svg"
|
||||
/>
|
||||
</React.Fragment>
|
||||
}
|
||||
) : (
|
||||
<FormattedMessage id="general.done" />
|
||||
)}
|
||||
title={`${this.props.intl.formatMessage(
|
||||
{id: 'registration.welcomeStepTitleNonEducator'},
|
||||
{username: this.props.username}
|
||||
|
@ -79,6 +81,7 @@ class WelcomeStep extends React.Component {
|
|||
}
|
||||
|
||||
WelcomeStep.propTypes = {
|
||||
createProjectOnComplete: PropTypes.bool,
|
||||
email: PropTypes.string,
|
||||
intl: intlShape,
|
||||
onNextStep: PropTypes.func,
|
||||
|
|
|
@ -6,7 +6,8 @@ const JoinFlow = require('../../join-flow/join-flow.jsx');
|
|||
require('./modal.scss');
|
||||
|
||||
const JoinModal = ({
|
||||
onCompleteRegistration, // eslint-disable-line no-unused-vars
|
||||
createProjectOnComplete,
|
||||
onCompleteRegistration,
|
||||
onRequestClose,
|
||||
...modalProps
|
||||
}) => (
|
||||
|
@ -20,12 +21,14 @@ const JoinModal = ({
|
|||
{...modalProps}
|
||||
>
|
||||
<JoinFlow
|
||||
createProjectOnComplete={createProjectOnComplete}
|
||||
onCompleteRegistration={onCompleteRegistration}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
JoinModal.propTypes = {
|
||||
createProjectOnComplete: PropTypes.bool,
|
||||
onCompleteRegistration: PropTypes.func,
|
||||
onRequestClose: PropTypes.func,
|
||||
showCloseButton: PropTypes.bool
|
||||
|
|
|
@ -8,12 +8,14 @@ const JoinModal = require('../modal/join/modal.jsx');
|
|||
require('./registration.scss');
|
||||
|
||||
const Registration = ({
|
||||
createProjectOnComplete,
|
||||
handleCloseRegistration,
|
||||
handleCompleteRegistration,
|
||||
isOpen
|
||||
}) => (
|
||||
<div>
|
||||
<JoinModal
|
||||
createProjectOnComplete={createProjectOnComplete}
|
||||
isOpen={isOpen}
|
||||
key="join-modal"
|
||||
onCompleteRegistration={handleCompleteRegistration}
|
||||
|
@ -23,8 +25,7 @@ const Registration = ({
|
|||
);
|
||||
|
||||
Registration.propTypes = {
|
||||
// used in mapDispatchToProps; eslint doesn't understand that this prop is used
|
||||
createProjectOnComplete: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types
|
||||
createProjectOnComplete: PropTypes.bool,
|
||||
handleCloseRegistration: PropTypes.func,
|
||||
handleCompleteRegistration: PropTypes.func,
|
||||
isOpen: PropTypes.bool
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
"general.confirmEmail": "Confirm Email",
|
||||
"general.contactUs": "Contact Us",
|
||||
"general.contact": "Contact",
|
||||
"general.done": "Done",
|
||||
"general.downloadPDF": "Download PDF",
|
||||
"general.emailUs": "Email Us",
|
||||
"general.conferences": "Conferences",
|
||||
|
|
Loading…
Reference in a new issue