-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove placeholders in favor of static labels - Add email button on register page - Remove zocial icons in favor of MDI svgs - Move “Forgot Password?” to near sign-in button - Small design adjustments
- Loading branch information
1 parent
35b9480
commit 5207714
Showing
11 changed files
with
275 additions
and
381 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,10 +59,7 @@ export class Register extends React.PureComponent<{}, any> { | |
}; | ||
|
||
let focus_empty = (focus_email?: boolean) => { | ||
if ( | ||
this.refs.username.value.trim() === "" || | ||
!this.validateUsername() | ||
) { | ||
if (this.refs.username.value.trim() === "" || !this.validateUsername()) { | ||
this.refs.username.focus(); | ||
return true; | ||
} | ||
|
@@ -113,17 +110,13 @@ export class Register extends React.PureComponent<{}, any> { | |
validateUsername = (ev?) => { | ||
if (/@/.test(this.refs.username.value)) { | ||
$(this.refs.username).addClass("validation-error"); | ||
this.setState({ | ||
error: _( | ||
"Your username will be publically visible, please do not use your email address here." | ||
) | ||
}); | ||
this.setState({ "error": _("Your username will be publically visible, please do not use your email address here.") }); | ||
this.refs.username.focus(); | ||
return false; | ||
} else { | ||
if ($(this.refs.username).hasClass("validation-error")) { | ||
$(this.refs.username).removeClass("validation-error"); | ||
this.setState({ error: null }); | ||
this.setState({ "error": null }); | ||
} | ||
} | ||
return true; | ||
|
@@ -135,100 +128,30 @@ export class Register extends React.PureComponent<{}, any> { | |
<Card> | ||
<h2>{_("Welcome new player!")}</h2> | ||
<form name="login" autoComplete="on"> | ||
<label htmlFor="username">Username</label> | ||
<input | ||
id="username" | ||
className="boxed" | ||
autoFocus | ||
ref="username" | ||
name="username" | ||
onKeyPress={this.register} | ||
onChange={this.validateUsername} | ||
placeholder={ | ||
_( | ||
"jack.smith" | ||
) /* translators: New account registration */ | ||
} | ||
/> | ||
{this.state.error && ( | ||
<div className="error-message"> | ||
{this.state.error} | ||
</div> | ||
)} | ||
<label htmlFor="password">Password</label> | ||
<input | ||
id="password" | ||
className="boxed" | ||
ref="password" | ||
type="password" | ||
name="password" | ||
onKeyPress={this.register} | ||
placeholder={ | ||
_( | ||
"your unique password" | ||
) /* translators: New account registration */ | ||
} | ||
/> | ||
<label htmlFor="email">Email (optional)</label> | ||
<input | ||
id="email" | ||
className="boxed" | ||
ref="email" | ||
type="email" | ||
name="email" | ||
onKeyPress={this.register} | ||
placeholder={ | ||
_( | ||
"[email protected]" | ||
) /* translators: New account registration */ | ||
} | ||
/> | ||
<div | ||
style={{ | ||
textAlign: "right", | ||
marginBottom: "1.0rem" | ||
}} | ||
> | ||
<label htmlFor="username">{_("Username") /* translators: New account registration */}</label> | ||
<input className="boxed" id="username" autoFocus ref="username" name="username" onKeyPress={this.register} onChange={this.validateUsername} /> | ||
{this.state.error && <div className="error-message">{this.state.error}</div>} | ||
<label htmlFor="password">{_("Password") /* translators: New account registration */}</label> | ||
<input className="boxed" id="password" ref="password" type="password" name="password" onKeyPress={this.register} /> | ||
<label htmlFor="email">{_("Email (optional)") /* translators: New account registration */}</label> | ||
<input className="boxed" id="email" ref="email" type="email" name="email" onKeyPress={this.register} /> | ||
<div style={{ textAlign: "right", marginBottom: "1.0rem" }}> | ||
<button className="primary" onClick={this.register}> | ||
<i className="fa fa-sign-in" /> {_("Sign up")} | ||
</button> | ||
</div> | ||
</form> | ||
|
||
<div className="social-buttons"> | ||
<LineText> | ||
{_( | ||
"or sign in with" | ||
) /* translators: username or password, or sign in with social authentication */} | ||
</LineText> | ||
<a | ||
className="zocial email icon" | ||
href="/sign-in/" | ||
target="_self" | ||
> | ||
</a> | ||
<a | ||
className="zocial google icon" | ||
href="/login/google-oauth2/" | ||
target="_self" | ||
> | ||
</a> | ||
<a | ||
className="zocial facebook icon" | ||
href="/login/facebook/" | ||
target="_self" | ||
> | ||
</a> | ||
<a | ||
className="zocial twitter icon" | ||
href="/login/twitter/" | ||
target="_self" | ||
> | ||
</a> | ||
<LineText>{ | ||
_("or sign in with") /* translators: username or password, or sign in with social authentication */ | ||
}</LineText> | ||
<div className="icons"> | ||
<Link to="/sign-in" className="mdi-icon email"><img src="/mdi-email-outline.svg" alt="Email" /></Link> | ||
<a href="/login/google-oauth2/" className="mdi-icon google"><img src="/mdi-google.svg" alt="Google" /></a> | ||
<a href="/login/facebook/" className="mdi-icon facebook"><img src="/mdi-facebook.svg" alt="Facebook" /></a> | ||
<a href="/login/twitter" className="mdi-icon twitter"><img src="/mdi-twitter.svg" alt="Twitter" /></a> | ||
</div> | ||
</div> | ||
</Card> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.