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