mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 23:27:54 -05:00
Merge pull request #3295 from benjiwheeler/join-flow-create-project
on complete join flow, take user to new project
This commit is contained in:
commit
008f600d99
3 changed files with 10 additions and 3 deletions
|
@ -217,6 +217,7 @@ class Navigation extends React.Component {
|
||||||
{this.props.registrationOpen && (
|
{this.props.registrationOpen && (
|
||||||
this.props.useScratch3Registration ? (
|
this.props.useScratch3Registration ? (
|
||||||
<Scratch3Registration
|
<Scratch3Registration
|
||||||
|
createProjectOnComplete
|
||||||
isOpen
|
isOpen
|
||||||
key="scratch3registration"
|
key="scratch3registration"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -23,17 +23,22 @@ const Registration = ({
|
||||||
);
|
);
|
||||||
|
|
||||||
Registration.propTypes = {
|
Registration.propTypes = {
|
||||||
|
createProjectOnComplete: PropTypes.bool,
|
||||||
handleCloseRegistration: PropTypes.func,
|
handleCloseRegistration: PropTypes.func,
|
||||||
handleCompleteRegistration: PropTypes.func,
|
handleCompleteRegistration: PropTypes.func,
|
||||||
isOpen: PropTypes.bool
|
isOpen: PropTypes.bool
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
Registration.defaultProps = {
|
||||||
|
createProjectOnComplete: false
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch, ownProps) => ({
|
||||||
handleCloseRegistration: () => {
|
handleCloseRegistration: () => {
|
||||||
dispatch(navigationActions.setRegistrationOpen(false));
|
dispatch(navigationActions.setRegistrationOpen(false));
|
||||||
},
|
},
|
||||||
handleCompleteRegistration: () => {
|
handleCompleteRegistration: () => {
|
||||||
dispatch(navigationActions.handleCompleteRegistration());
|
dispatch(navigationActions.handleCompleteRegistration(ownProps.createProjectOnComplete));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -92,9 +92,10 @@ module.exports.setSearchTerm = searchTerm => ({
|
||||||
searchTerm: searchTerm
|
searchTerm: searchTerm
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports.handleCompleteRegistration = () => (dispatch => {
|
module.exports.handleCompleteRegistration = createProject => (dispatch => {
|
||||||
dispatch(sessionActions.refreshSession());
|
dispatch(sessionActions.refreshSession());
|
||||||
dispatch(module.exports.setRegistrationOpen(false));
|
dispatch(module.exports.setRegistrationOpen(false));
|
||||||
|
if (createProject) window.location = '/projects/editor/?tutorial=getStarted';
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports.handleLogIn = (formData, callback) => (dispatch => {
|
module.exports.handleLogIn = (formData, callback) => (dispatch => {
|
||||||
|
|
Loading…
Reference in a new issue