File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,9 @@ export default function Login(
149
149
</ div >
150
150
</ div >
151
151
) }
152
- { social . providers . length !== 0 && < h5 > { msgStr ( "selfCredentials" ) } </ h5 > }
152
+ { social ?. providers ?. length !== 0 && (
153
+ < h5 > { msgStr ( "selfCredentials" ) } </ h5 >
154
+ ) }
153
155
< div className = { classes . inputs } >
154
156
{ ( ( ) => {
155
157
const label = ! realm . loginWithEmailAllowed
@@ -161,9 +163,10 @@ export default function Login(
161
163
const autoCompleteHelper : typeof label =
162
164
label === "usernameOrEmail" ? "username" : label ;
163
165
164
- const usernameInputType = realm . registrationEmailAsUsername
165
- ? "email"
166
- : "text"
166
+ const usernameInputType =
167
+ realm . registrationEmailAsUsername
168
+ ? "email"
169
+ : "text" ;
167
170
168
171
return (
169
172
< Input
@@ -180,7 +183,14 @@ export default function Login(
180
183
"autoComplete" : "off"
181
184
} )
182
185
} }
183
- label = { usernameInputType === "email" ? msgStr ( "email" ) : msgStr ( "emailOrUsername" ) }
186
+ label = { ( ( ) => {
187
+ switch ( usernameInputType ) {
188
+ case "email" :
189
+ return msgStr ( "email" ) ;
190
+ case "text" :
191
+ return msgStr ( "username" ) ;
192
+ }
193
+ } ) ( ) }
184
194
hintText = { msgStr ( "email hint" ) }
185
195
/>
186
196
) ;
You can’t perform that action at this time.
0 commit comments