@@ -26,6 +26,7 @@ import RegistrationEmailPromptDialog from "../dialogs/RegistrationEmailPromptDia
2626import CountryDropdown from "./CountryDropdown" ;
2727import PassphraseConfirmField from "./PassphraseConfirmField" ;
2828import { PosthogAnalytics } from "../../../PosthogAnalytics" ;
29+ import { Alignment } from "../elements/Tooltip" ;
2930
3031enum RegistrationField {
3132 Email = "field_email" ,
@@ -58,6 +59,7 @@ interface IProps {
5859 serverConfig : ValidatedServerConfig ;
5960 canSubmit ?: boolean ;
6061 matrixClient : MatrixClient ;
62+ mobileRegister ?: boolean ;
6163
6264 onRegisterClick ( params : {
6365 username : string ;
@@ -439,6 +441,13 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
439441 return true ;
440442 }
441443
444+ private tooltipAlignment ( ) : Alignment | undefined {
445+ if ( this . props . mobileRegister ) {
446+ return Alignment . Bottom ;
447+ }
448+ return undefined ;
449+ }
450+
442451 private renderEmail ( ) : ReactNode {
443452 if ( ! this . showEmail ( ) ) {
444453 return null ;
@@ -454,6 +463,7 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
454463 validationRules = { this . validateEmailRules . bind ( this ) }
455464 onChange = { this . onEmailChange }
456465 onValidate = { this . onEmailValidate }
466+ tooltipAlignment = { this . tooltipAlignment ( ) }
457467 />
458468 ) ;
459469 }
@@ -468,6 +478,7 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
468478 onChange = { this . onPasswordChange }
469479 onValidate = { this . onPasswordValidate }
470480 userInputs = { [ this . state . username ] }
481+ tooltipAlignment = { this . tooltipAlignment ( ) }
471482 />
472483 ) ;
473484 }
@@ -482,6 +493,7 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
482493 password = { this . state . password }
483494 onChange = { this . onPasswordConfirmChange }
484495 onValidate = { this . onPasswordConfirmValidate }
496+ tooltipAlignment = { this . tooltipAlignment ( ) }
485497 />
486498 ) ;
487499 }
@@ -526,6 +538,9 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
526538 value = { this . state . username }
527539 onChange = { this . onUsernameChange }
528540 onValidate = { this . onUsernameValidate }
541+ tooltipAlignment = { this . tooltipAlignment ( ) }
542+ autoCorrect = "off"
543+ autoCapitalize = "none"
529544 />
530545 ) ;
531546 }
@@ -557,14 +572,28 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
557572 }
558573 }
559574
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+
560592 return (
561593 < div >
562594 < form onSubmit = { this . onSubmit } >
563595 < div className = "mx_AuthBody_fieldRow" > { this . renderUsername ( ) } </ div >
564- < div className = "mx_AuthBody_fieldRow" >
565- { this . renderPassword ( ) }
566- { this . renderPasswordConfirm ( ) }
567- </ div >
596+ { passwordFields }
568597 < div className = "mx_AuthBody_fieldRow" >
569598 { this . renderEmail ( ) }
570599 { this . renderPhoneNumber ( ) }
0 commit comments