mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-13 09:11:19 -05:00
49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
const PropTypes = require('prop-types');
|
|
const React = require('react');
|
|
const connect = require('react-redux').connect;
|
|
|
|
const navigationActions = require('../../redux/navigation.js');
|
|
const JoinModal = require('../modal/join/modal.jsx');
|
|
|
|
require('./registration.scss');
|
|
|
|
const Registration = ({
|
|
createProjectOnComplete,
|
|
handleCloseRegistration,
|
|
handleCompleteRegistration,
|
|
isOpen,
|
|
showCloseButton
|
|
}) => (
|
|
<div>
|
|
<JoinModal
|
|
createProjectOnComplete={createProjectOnComplete}
|
|
isOpen={isOpen}
|
|
key="join-modal"
|
|
showCloseButton={showCloseButton}
|
|
onCompleteRegistration={handleCompleteRegistration}
|
|
onRequestClose={handleCloseRegistration}
|
|
/>
|
|
</div>
|
|
);
|
|
|
|
Registration.propTypes = {
|
|
createProjectOnComplete: PropTypes.bool,
|
|
handleCloseRegistration: PropTypes.func,
|
|
handleCompleteRegistration: PropTypes.func,
|
|
isOpen: PropTypes.bool,
|
|
showCloseButton: PropTypes.bool
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch, ownProps) => ({
|
|
handleCloseRegistration: () => {
|
|
dispatch(navigationActions.setRegistrationOpen(false));
|
|
},
|
|
handleCompleteRegistration: () => {
|
|
dispatch(navigationActions.handleCompleteRegistration(ownProps.createProjectOnComplete));
|
|
}
|
|
});
|
|
|
|
module.exports = connect(
|
|
() => ({}),
|
|
mapDispatchToProps
|
|
)(Registration);
|