Skip to content

Commit edb5e10

Browse files
committed
Iterate registration to simplify it based on usertesting
1 parent b3ccabb commit edb5e10

File tree

5 files changed

+86
-59
lines changed

5 files changed

+86
-59
lines changed

res/css/views/auth/_InteractiveAuthEntryComponents.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,35 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
.mx_InteractiveAuthEntryComponents_emailWrapper {
18+
padding-right: 60px;
19+
position: relative;
20+
margin-top: 32px;
21+
margin-bottom: 32px;
22+
23+
&::before, &::after {
24+
position: absolute;
25+
width: 116px;
26+
height: 116px;
27+
content: "";
28+
right: -10px;
29+
}
30+
31+
&::before {
32+
background-color: rgba(244, 246, 250, 0.91);
33+
border-radius: 50%;
34+
top: -20px;
35+
}
36+
37+
&::after {
38+
background-image: url('$(res)/img/element-icons/email-prompt.svg');
39+
background-repeat: no-repeat;
40+
background-position: center;
41+
background-size: contain;
42+
top: -25px;
43+
}
44+
}
45+
1746
.mx_InteractiveAuthEntryComponents_msisdnWrapper {
1847
text-align: center;
1948
}
Lines changed: 13 additions & 0 deletions
Loading

src/components/structures/auth/Registration.js

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -502,17 +502,9 @@ export default class Registration extends React.Component {
502502
return null;
503503
}
504504

505-
// If we're on a different phase, we only show the server type selector,
506-
// which is always shown if we allow custom URLs at all.
507-
// (if there's a fatal server error, we need to show the full server
508-
// config as the user may need to change servers to resolve the error).
509-
if (PHASES_ENABLED && this.state.phase !== PHASE_SERVER_DETAILS && !this.state.serverErrorIsFatal) {
510-
return <div>
511-
<ServerTypeSelector
512-
selected={this.state.serverType}
513-
onChange={this.onServerTypeChange}
514-
/>
515-
</div>;
505+
// Hide the server picker once the user is doing UI Auth unless encountered a fatal server error
506+
if (this.state.phase !== PHASE_SERVER_DETAILS && this.state.doingUIAuth && !this.state.serverErrorIsFatal) {
507+
return null;
516508
}
517509

518510
const serverDetailsProps = {};
@@ -582,25 +574,13 @@ export default class Registration extends React.Component {
582574
<Spinner />
583575
</div>;
584576
} else if (this.state.flows.length) {
585-
let onEditServerDetailsClick = null;
586-
// If custom URLs are allowed and we haven't selected the Free server type, wire
587-
// up the server details edit link.
588-
if (
589-
PHASES_ENABLED &&
590-
!SdkConfig.get()['disable_custom_urls'] &&
591-
this.state.serverType !== ServerType.FREE
592-
) {
593-
onEditServerDetailsClick = this.onEditServerDetailsClick;
594-
}
595-
596577
return <RegistrationForm
597578
defaultUsername={this.state.formVals.username}
598579
defaultEmail={this.state.formVals.email}
599580
defaultPhoneCountry={this.state.formVals.phoneCountry}
600581
defaultPhoneNumber={this.state.formVals.phoneNumber}
601582
defaultPassword={this.state.formVals.password}
602583
onRegisterClick={this.onFormSubmit}
603-
onEditServerDetailsClick={onEditServerDetailsClick}
604584
flows={this.state.flows}
605585
serverConfig={this.props.serverConfig}
606586
canSubmit={!this.state.serverErrorIsFatal}
@@ -686,11 +666,48 @@ export default class Registration extends React.Component {
686666
{ regDoneText }
687667
</div>;
688668
} else {
669+
let yourMatrixAccountText = _t('Create your Matrix account on %(serverName)s', {
670+
serverName: this.props.serverConfig.hsName,
671+
});
672+
if (this.props.serverConfig.hsNameIsDifferent) {
673+
const TextWithTooltip = sdk.getComponent("elements.TextWithTooltip");
674+
675+
yourMatrixAccountText = _t('Create your Matrix account on <underlinedServerName />', {}, {
676+
'underlinedServerName': () => {
677+
return <TextWithTooltip
678+
class="mx_Login_underlinedServerName"
679+
tooltip={this.props.serverConfig.hsUrl}
680+
>
681+
{this.props.serverConfig.hsName}
682+
</TextWithTooltip>;
683+
},
684+
});
685+
}
686+
687+
// If custom URLs are allowed, user is not doing UIA flows and they haven't selected the Free server type,
688+
// wire up the server details edit link.
689+
let editLink = null;
690+
if (PHASES_ENABLED &&
691+
!SdkConfig.get()['disable_custom_urls'] &&
692+
this.state.serverType !== ServerType.FREE &&
693+
!this.state.doingUIAuth
694+
) {
695+
editLink = (
696+
<a className="mx_AuthBody_editServerDetails" href="#" onClick={this.onEditServerDetailsClick}>
697+
{_t('Change')}
698+
</a>
699+
);
700+
}
701+
689702
body = <div>
690703
<h2>{ _t('Create your account') }</h2>
691704
{ errorText }
692705
{ serverDeadSection }
693706
{ this.renderServerComponent() }
707+
<h3>
708+
{yourMatrixAccountText}
709+
{editLink}
710+
</h3>
694711
{ this.renderRegisterComponent() }
695712
{ goBack }
696713
{ signIn }

src/components/views/auth/InteractiveAuthEntryComponents.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,12 +421,12 @@ export class EmailIdentityAuthEntry extends React.Component {
421421
return <Spinner />;
422422
} else {
423423
return (
424-
<div>
425-
<p>{ _t("An email has been sent to %(emailAddress)s",
426-
{ emailAddress: (sub) => <i>{ this.props.inputs.emailAddress }</i> },
424+
<div className="mx_InteractiveAuthEntryComponents_emailWrapper">
425+
<p>{ _t("A confirmation email has been sent to %(emailAddress)s",
426+
{ emailAddress: (sub) => <b>{ this.props.inputs.emailAddress }</b> },
427427
) }
428428
</p>
429-
<p>{ _t("Please check your email to continue registration.") }</p>
429+
<p>{ _t("Open the link in the email to continue registration.") }</p>
430430
</div>
431431
);
432432
}

src/components/views/auth/RegistrationForm.js

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export default class RegistrationForm extends React.Component {
5151
defaultUsername: PropTypes.string,
5252
defaultPassword: PropTypes.string,
5353
onRegisterClick: PropTypes.func.isRequired, // onRegisterClick(Object) => ?Promise
54-
onEditServerDetailsClick: PropTypes.func,
5554
flows: PropTypes.arrayOf(PropTypes.object).isRequired,
5655
serverConfig: PropTypes.instanceOf(ValidatedServerConfig).isRequired,
5756
canSubmit: PropTypes.bool,
@@ -513,33 +512,6 @@ export default class RegistrationForm extends React.Component {
513512
}
514513

515514
render() {
516-
let yourMatrixAccountText = _t('Create your Matrix account on %(serverName)s', {
517-
serverName: this.props.serverConfig.hsName,
518-
});
519-
if (this.props.serverConfig.hsNameIsDifferent) {
520-
const TextWithTooltip = sdk.getComponent("elements.TextWithTooltip");
521-
522-
yourMatrixAccountText = _t('Create your Matrix account on <underlinedServerName />', {}, {
523-
'underlinedServerName': () => {
524-
return <TextWithTooltip
525-
class="mx_Login_underlinedServerName"
526-
tooltip={this.props.serverConfig.hsUrl}
527-
>
528-
{this.props.serverConfig.hsName}
529-
</TextWithTooltip>;
530-
},
531-
});
532-
}
533-
534-
let editLink = null;
535-
if (this.props.onEditServerDetailsClick) {
536-
editLink = <a className="mx_AuthBody_editServerDetails"
537-
href="#" onClick={this.props.onEditServerDetailsClick}
538-
>
539-
{_t('Change')}
540-
</a>;
541-
}
542-
543515
const registerButton = (
544516
<input className="mx_Login_submit" type="submit" value={_t("Register")} disabled={!this.props.canSubmit} />
545517
);
@@ -575,10 +547,6 @@ export default class RegistrationForm extends React.Component {
575547

576548
return (
577549
<div>
578-
<h3>
579-
{yourMatrixAccountText}
580-
{editLink}
581-
</h3>
582550
<form onSubmit={this.onSubmit}>
583551
<div className="mx_AuthBody_fieldRow">
584552
{this.renderUsername()}

0 commit comments

Comments
 (0)