@@ -31,30 +31,7 @@ const ChangeRecoveryEmailPopup = props => {
3131 hasError = { props . recoveryEmailPopupInputEmail . hasError }
3232 errorMessage = { props . recoveryEmailPopupInputEmail . errorMessage }
3333 />
34- < div className = "popup-paragraph" >
35- < p > { passwordText } </ p >
36- </ div >
37- < ChangePasswordPopupInput
38- name = { props . recoveryEmailPopupInputPassword . name }
39- type = { props . recoveryEmailPopupInputPassword . type }
40- value = { props . recoveryEmailPopupInputPassword . value }
41- icon = { props . recoveryEmailPopupInputPassword . icon }
42- placeholder = {
43- string . popups . change_recovery_email . input . password . placeholder
44- }
45- onChangeValue = { props . onChangeInputValueOnChangeRecoveryEmailPopup }
46- onChangeType = { props . onClickChangeRecoveryEmailInputType }
47- hasError = { props . recoveryEmailPopupInputPassword . hasError }
48- errorMessage = { props . recoveryEmailPopupInputPassword . errorMessage }
49- />
50- < div className = "forgot-password-link" >
51- < button
52- className = "button button-b"
53- onClick = { props . onClickForgotPasswordLink }
54- >
55- { string . popups . change_recovery_email . input . password . button }
56- </ button >
57- </ div >
34+ { renderPasswordIfRecoveryEmailIsConfirmed ( props ) }
5835 </ div >
5936 < div className = "popup-paragraph change-recovery-email-note" >
6037 < p >
@@ -98,6 +75,39 @@ const ChangePasswordPopupInput = ({
9875 </ div >
9976) ;
10077
78+ const renderPasswordIfRecoveryEmailIsConfirmed = props => {
79+ if ( props . recoveryEmailConfirmed ) {
80+ return (
81+ < div >
82+ < div className = "popup-paragraph" >
83+ < p > { passwordText } </ p >
84+ </ div >
85+ < ChangePasswordPopupInput
86+ name = { props . recoveryEmailPopupInputPassword . name }
87+ type = { props . recoveryEmailPopupInputPassword . type }
88+ value = { props . recoveryEmailPopupInputPassword . value }
89+ icon = { props . recoveryEmailPopupInputPassword . icon }
90+ placeholder = {
91+ string . popups . change_recovery_email . input . password . placeholder
92+ }
93+ onChangeValue = { props . onChangeInputValueOnChangeRecoveryEmailPopup }
94+ onChangeType = { props . onClickChangeRecoveryEmailInputType }
95+ hasError = { props . recoveryEmailPopupInputPassword . hasError }
96+ errorMessage = { props . recoveryEmailPopupInputPassword . errorMessage }
97+ />
98+ < div className = "forgot-password-link" >
99+ < button
100+ className = "button button-b"
101+ onClick = { props . onClickForgotPasswordLink }
102+ >
103+ { string . popups . change_recovery_email . input . password . button }
104+ </ button >
105+ </ div >
106+ </ div >
107+ ) ;
108+ }
109+ } ;
110+
101111const InputErrorMessage = ( { hasError, errorMessage, value } ) => {
102112 const shouldRenderMessage =
103113 hasError && errorMessage . length > 0 && value . length > 0 ;
0 commit comments