mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Move flag that controls which join flow we use to redux
This commit is contained in:
parent
98bb0cbb11
commit
4146a7a308
3 changed files with 16 additions and 11 deletions
|
@ -23,8 +23,6 @@ const AccountNav = require('./accountnav.jsx');
|
|||
|
||||
require('./navigation.scss');
|
||||
|
||||
const USE_SCRATCH3_REGISTRATION = false;
|
||||
|
||||
class Navigation extends React.Component {
|
||||
constructor (props) {
|
||||
super(props);
|
||||
|
@ -217,7 +215,7 @@ class Navigation extends React.Component {
|
|||
]) : []
|
||||
}
|
||||
{this.props.registrationOpen && (
|
||||
USE_SCRATCH3_REGISTRATION ? (
|
||||
this.props.useScratch3Registration ? (
|
||||
<Scratch3Registration
|
||||
key="scratch3registration"
|
||||
/>
|
||||
|
@ -262,7 +260,8 @@ Navigation.propTypes = {
|
|||
classroomId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
||||
thumbnailUrl: PropTypes.string,
|
||||
username: PropTypes.string
|
||||
})
|
||||
}),
|
||||
useScratch3Registration: PropTypes.bool
|
||||
};
|
||||
|
||||
Navigation.defaultProps = {
|
||||
|
@ -278,7 +277,8 @@ const mapStateToProps = state => ({
|
|||
registrationOpen: state.navigation.registrationOpen,
|
||||
searchTerm: state.navigation.searchTerm,
|
||||
unreadMessageCount: state.messageCount.messageCount,
|
||||
user: state.session && state.session.session && state.session.session.user
|
||||
user: state.session && state.session.session && state.session.session.user,
|
||||
useScratch3Registration: state.navigation.useScratch3Registration
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
|
|
@ -18,6 +18,7 @@ const Types = keyMirror({
|
|||
});
|
||||
|
||||
module.exports.getInitialState = () => ({
|
||||
useScratch3Registration: true,
|
||||
accountNavOpen: false,
|
||||
canceledDeletionOpen: false,
|
||||
loginError: null,
|
||||
|
|
|
@ -33,8 +33,6 @@ const frameless = require('../../lib/frameless');
|
|||
const GUI = require('scratch-gui');
|
||||
const IntlGUI = injectIntl(GUI.default);
|
||||
|
||||
const USE_SCRATCH3_REGISTRATION = false;
|
||||
|
||||
const localStorageAvailable = 'localStorage' in window && window.localStorage !== null;
|
||||
|
||||
const Sentry = require('@sentry/browser');
|
||||
|
@ -754,10 +752,12 @@ class Preview extends React.Component {
|
|||
onUpdateProjectThumbnail={this.props.handleUpdateProjectThumbnail}
|
||||
onUpdateProjectTitle={this.handleUpdateProjectTitle}
|
||||
/>
|
||||
{USE_SCRATCH3_REGISTRATION ? (
|
||||
<Scratch3Registration />
|
||||
) : (
|
||||
<Registration />
|
||||
{this.props.registrationOpen && (
|
||||
this.props.useScratch3Registration ? (
|
||||
<Scratch3Registration />
|
||||
) : (
|
||||
<Registration />
|
||||
)
|
||||
)}
|
||||
<CanceledDeletionModal />
|
||||
</React.Fragment>
|
||||
|
@ -829,6 +829,7 @@ Preview.propTypes = {
|
|||
projectInfo: projectShape,
|
||||
projectNotAvailable: PropTypes.bool,
|
||||
projectStudios: PropTypes.arrayOf(PropTypes.object),
|
||||
registrationOpen: PropTypes.bool,
|
||||
remixProject: PropTypes.func,
|
||||
remixes: PropTypes.arrayOf(PropTypes.object),
|
||||
replies: PropTypes.objectOf(PropTypes.array),
|
||||
|
@ -842,6 +843,7 @@ Preview.propTypes = {
|
|||
shareProject: PropTypes.func.isRequired,
|
||||
toggleStudio: PropTypes.func.isRequired,
|
||||
updateProject: PropTypes.func.isRequired,
|
||||
useScratch3Registration: PropTypes.bool,
|
||||
user: PropTypes.shape({
|
||||
id: PropTypes.number,
|
||||
banned: PropTypes.bool,
|
||||
|
@ -934,9 +936,11 @@ const mapStateToProps = state => {
|
|||
projectInfo: state.preview.projectInfo,
|
||||
projectNotAvailable: state.preview.projectNotAvailable,
|
||||
projectStudios: state.preview.projectStudios,
|
||||
registrationOpen: state.navigation.registrationOpen,
|
||||
remixes: state.preview.remixes,
|
||||
replies: state.preview.replies,
|
||||
sessionStatus: state.session.status, // check if used
|
||||
useScratch3Registration: state.navigation.useScratch3Registration,
|
||||
user: state.session.session.user,
|
||||
userOwnsProject: userOwnsProject,
|
||||
userPresent: userPresent,
|
||||
|
|
Loading…
Reference in a new issue