Merge pull request #3389 from benjiwheeler/join-flow-navigate-when-finished

Join flow navigate when finished
This commit is contained in:
Benjamin Wheeler 2019-09-24 20:08:18 -04:00 committed by GitHub
commit af15188377
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 9 deletions

View file

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

View file

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

View file

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

View file

@ -8,14 +8,18 @@ const JoinModal = require('../modal/join/modal.jsx');
require('./registration.scss'); require('./registration.scss');
const Registration = ({ const Registration = ({
createProjectOnComplete,
handleCloseRegistration, handleCloseRegistration,
handleCompleteRegistration, handleCompleteRegistration,
isOpen isOpen,
showCloseButton
}) => ( }) => (
<div> <div>
<JoinModal <JoinModal
createProjectOnComplete={createProjectOnComplete}
isOpen={isOpen} isOpen={isOpen}
key="join-modal" key="join-modal"
showCloseButton={showCloseButton}
onCompleteRegistration={handleCompleteRegistration} onCompleteRegistration={handleCompleteRegistration}
onRequestClose={handleCloseRegistration} onRequestClose={handleCloseRegistration}
/> />
@ -23,11 +27,11 @@ 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,
showCloseButton: PropTypes.bool
}; };
const mapDispatchToProps = (dispatch, ownProps) => ({ const mapDispatchToProps = (dispatch, ownProps) => ({

View file

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

View file

@ -1,6 +1,6 @@
const React = require('react'); const React = require('react');
const render = require('../../lib/render.jsx'); const render = require('../../lib/render.jsx');
const JoinModal = require('../../components/modal/join/modal.jsx'); const Scratch3Registration = require('../../components/registration/scratch3-registration.jsx');
const ErrorBoundary = require('../../components/errorboundary/errorboundary.jsx'); const ErrorBoundary = require('../../components/errorboundary/errorboundary.jsx');
// Require this even though we don't use it because, without it, webpack runs out of memory... // Require this even though we don't use it because, without it, webpack runs out of memory...
const Page = require('../../components/page/www/page.jsx'); // eslint-disable-line no-unused-vars const Page = require('../../components/page/www/page.jsx'); // eslint-disable-line no-unused-vars
@ -20,7 +20,8 @@ const Register = () => (
</a> </a>
</div> </div>
<JoinModal <Scratch3Registration
createProjectOnComplete
isOpen isOpen
key="scratch3registration" key="scratch3registration"
showCloseButton={false} showCloseButton={false}