pass createProjectOnComplete prop through join flow

…so welcome step can display correct completion text
This commit is contained in:
Ben Wheeler 2019-09-23 11:25:10 -04:00
parent 465a87d453
commit 691faabe28
5 changed files with 15 additions and 5 deletions

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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",