11import React , { useEffect , useState } from 'react' ;
2- import { connect , useDispatch , useSelector } from 'react-redux' ;
2+ import { connect } from 'react-redux' ;
33
44import { getConfig } from '@edx/frontend-platform' ;
55import { sendPageEvent , sendTrackEvent } from '@edx/frontend-platform/analytics' ;
66import { getAuthService } from '@edx/frontend-platform/auth' ;
77import { useIntl } from '@edx/frontend-platform/i18n' ;
88import {
9- Icon , IconButton ,
9+ Icon ,
1010 Tab ,
1111 Tabs ,
1212} from '@openedx/paragon' ;
13- import { ArrowBackIos , ChevronLeft } from '@openedx/paragon/icons' ;
13+ import { ChevronLeft } from '@openedx/paragon/icons' ;
1414import PropTypes from 'prop-types' ;
1515import { Navigate , useNavigate } from 'react-router-dom' ;
1616
@@ -27,8 +27,7 @@ import {
2727import { LoginPage } from '../login' ;
2828import { backupLoginForm } from '../login/data/actions' ;
2929import { RegistrationPage } from '../register' ;
30- import { backupRegistrationForm , setSimplifyRegExperimentData } from '../register/data/actions' ;
31- import { FIRST_STEP , SECOND_STEP } from '../register/data/optimizelyExperiment/helper' ;
30+ import { backupRegistrationForm } from '../register/data/actions' ;
3231
3332const Logistration = ( props ) => {
3433 const { selectedPage, tpaProviders } = props ;
@@ -43,9 +42,6 @@ const Logistration = (props) => {
4342 const disablePublicAccountCreation = getConfig ( ) . ALLOW_PUBLIC_ACCOUNT_CREATION === false ;
4443 const hideRegistrationLink = getConfig ( ) . SHOW_REGISTRATION_LINKS === false ;
4544
46- const dispatch = useDispatch ( ) ;
47- const { simplifyRegExpVariation, simplifiedRegisterPageStep } = useSelector ( state => state . register ) ;
48-
4945 useEffect ( ( ) => {
5046 const authService = getAuthService ( ) ;
5147 if ( authService ) {
@@ -100,38 +96,6 @@ const Logistration = (props) => {
10096 return ! ! provider ;
10197 } ;
10298
103- /**
104- * Temporary function created to resolve the complexity in tabs conditioning for simplify
105- * registration experiment
106- */
107- const getTabs = ( ) => {
108- if ( simplifiedRegisterPageStep === SECOND_STEP ) {
109- return (
110- < div >
111- < IconButton
112- key = "primary"
113- src = { ArrowBackIos }
114- iconAs = { Icon }
115- alt = "Back"
116- onClick = { ( ) => {
117- dispatch ( setSimplifyRegExperimentData ( simplifyRegExpVariation , FIRST_STEP ) ) ;
118- } }
119- variant = "primary"
120- size = "inline"
121- className = "mr-1"
122- />
123- { formatMessage ( messages [ 'tab.back.btn.text' ] ) }
124- </ div >
125- ) ;
126- }
127- return (
128- < Tabs defaultActiveKey = { selectedPage } id = "controlled-tab" onSelect = { ( tabKey ) => handleOnSelect ( tabKey , selectedPage ) } >
129- < Tab title = { formatMessage ( messages [ 'logistration.register' ] ) } eventKey = { REGISTER_PAGE } />
130- < Tab title = { formatMessage ( messages [ 'logistration.sign.in' ] ) } eventKey = { LOGIN_PAGE } />
131- </ Tabs >
132- ) ;
133- } ;
134-
13599 return (
136100 < BaseContainer >
137101 < div >
@@ -159,7 +123,12 @@ const Logistration = (props) => {
159123 < Tab title = { tabTitle } eventKey = { selectedPage === LOGIN_PAGE ? LOGIN_PAGE : REGISTER_PAGE } />
160124 </ Tabs >
161125 )
162- : ( ! isValidTpaHint ( ) && ! hideRegistrationLink && getTabs ( ) ) }
126+ : ( ! isValidTpaHint ( ) && ! hideRegistrationLink && (
127+ < Tabs defaultActiveKey = { selectedPage } id = "controlled-tab" onSelect = { ( tabKey ) => handleOnSelect ( tabKey , selectedPage ) } >
128+ < Tab title = { formatMessage ( messages [ 'logistration.register' ] ) } eventKey = { REGISTER_PAGE } />
129+ < Tab title = { formatMessage ( messages [ 'logistration.sign.in' ] ) } eventKey = { LOGIN_PAGE } />
130+ </ Tabs >
131+ ) ) }
163132 { key && (
164133 < Navigate to = { updatePathWithQueryParams ( key ) } replace />
165134 ) }
0 commit comments