@@ -26,6 +26,7 @@ import RegistrationEmailPromptDialog from "../dialogs/RegistrationEmailPromptDia
26
26
import CountryDropdown from "./CountryDropdown" ;
27
27
import PassphraseConfirmField from "./PassphraseConfirmField" ;
28
28
import { PosthogAnalytics } from "../../../PosthogAnalytics" ;
29
+ import { Alignment } from "../elements/Tooltip" ;
29
30
30
31
enum RegistrationField {
31
32
Email = "field_email" ,
@@ -58,6 +59,7 @@ interface IProps {
58
59
serverConfig : ValidatedServerConfig ;
59
60
canSubmit ?: boolean ;
60
61
matrixClient : MatrixClient ;
62
+ mobileRegister ?: boolean ;
61
63
62
64
onRegisterClick ( params : {
63
65
username : string ;
@@ -439,6 +441,13 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
439
441
return true ;
440
442
}
441
443
444
+ private tooltipAlignment ( ) : Alignment | undefined {
445
+ if ( this . props . mobileRegister ) {
446
+ return Alignment . Bottom ;
447
+ }
448
+ return undefined ;
449
+ }
450
+
442
451
private renderEmail ( ) : ReactNode {
443
452
if ( ! this . showEmail ( ) ) {
444
453
return null ;
@@ -454,6 +463,7 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
454
463
validationRules = { this . validateEmailRules . bind ( this ) }
455
464
onChange = { this . onEmailChange }
456
465
onValidate = { this . onEmailValidate }
466
+ tooltipAlignment = { this . tooltipAlignment ( ) }
457
467
/>
458
468
) ;
459
469
}
@@ -468,6 +478,7 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
468
478
onChange = { this . onPasswordChange }
469
479
onValidate = { this . onPasswordValidate }
470
480
userInputs = { [ this . state . username ] }
481
+ tooltipAlignment = { this . tooltipAlignment ( ) }
471
482
/>
472
483
) ;
473
484
}
@@ -482,6 +493,7 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
482
493
password = { this . state . password }
483
494
onChange = { this . onPasswordConfirmChange }
484
495
onValidate = { this . onPasswordConfirmValidate }
496
+ tooltipAlignment = { this . tooltipAlignment ( ) }
485
497
/>
486
498
) ;
487
499
}
@@ -526,6 +538,9 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
526
538
value = { this . state . username }
527
539
onChange = { this . onUsernameChange }
528
540
onValidate = { this . onUsernameValidate }
541
+ tooltipAlignment = { this . tooltipAlignment ( ) }
542
+ autoCorrect = "off"
543
+ autoCapitalize = "none"
529
544
/>
530
545
) ;
531
546
}
@@ -557,14 +572,28 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
557
572
}
558
573
}
559
574
575
+ let passwordFields : JSX . Element | undefined ;
576
+ if ( this . props . mobileRegister ) {
577
+ passwordFields = (
578
+ < >
579
+ < div className = "mx_AuthBody_fieldRow" > { this . renderPassword ( ) } </ div >
580
+ < div className = "mx_AuthBody_fieldRow" > { this . renderPasswordConfirm ( ) } </ div >
581
+ </ >
582
+ ) ;
583
+ } else {
584
+ passwordFields = (
585
+ < div className = "mx_AuthBody_fieldRow" >
586
+ { this . renderPassword ( ) }
587
+ { this . renderPasswordConfirm ( ) }
588
+ </ div >
589
+ ) ;
590
+ }
591
+
560
592
return (
561
593
< div >
562
594
< form onSubmit = { this . onSubmit } >
563
595
< div className = "mx_AuthBody_fieldRow" > { this . renderUsername ( ) } </ div >
564
- < div className = "mx_AuthBody_fieldRow" >
565
- { this . renderPassword ( ) }
566
- { this . renderPasswordConfirm ( ) }
567
- </ div >
596
+ { passwordFields }
568
597
< div className = "mx_AuthBody_fieldRow" >
569
598
{ this . renderEmail ( ) }
570
599
{ this . renderPhoneNumber ( ) }
0 commit comments