mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-21 13:06:01 +08:00
refactor(sign in): use button elements instead of div
This commit is contained in:
parent
43a8b081a5
commit
6fef51cd89
3 changed files with 16 additions and 21 deletions
|
@ -442,8 +442,9 @@ export function signOut(): void {
|
|||
AccountButton.update();
|
||||
navigate("/login");
|
||||
DB.setSnapshot(undefined);
|
||||
$(".pageLogin .button").removeClass("disabled");
|
||||
$(".pageLogin input").prop("disabled", false);
|
||||
LoginPage.enableSignInButton();
|
||||
LoginPage.enableSignUpButton();
|
||||
LoginPage.enableInputs();
|
||||
$("#top .signInOut .icon").html(`<i class="far fa-fw fa-user"></i>`);
|
||||
setTimeout(() => {
|
||||
hideFavoriteQuoteLength();
|
||||
|
@ -561,8 +562,6 @@ async function signUp(): Promise<void> {
|
|||
await sendVerificationEmail();
|
||||
AllTimeStats.clear();
|
||||
$("#menu .textButton.account .text").text(nname);
|
||||
$(".pageLogin .button").removeClass("disabled");
|
||||
$(".pageLogin input").prop("disabled", false);
|
||||
LoginPage.hidePreloader();
|
||||
await loadUser(createdAuthUser.user);
|
||||
if (TestLogic.notSignedInLastResult !== null) {
|
||||
|
@ -607,17 +606,12 @@ async function signUp(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
$(".pageLogin .login input").keyup((e) => {
|
||||
if (e.key === "Enter") {
|
||||
signIn();
|
||||
}
|
||||
});
|
||||
|
||||
$(".pageLogin .login .button.signIn").on("click", () => {
|
||||
$(".pageLogin .login form").on("submit", (e) => {
|
||||
e.preventDefault();
|
||||
signIn();
|
||||
});
|
||||
|
||||
$(".pageLogin .login .button.signInWithGoogle").on("click", () => {
|
||||
$(".pageLogin .login button.signInWithGoogle").on("click", () => {
|
||||
signInWithGoogle();
|
||||
});
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ export function disableSignUpButton(): void {
|
|||
}
|
||||
|
||||
export function enableSignInButton(): void {
|
||||
$(".page.pageLogin .login.side .button").removeClass("disabled");
|
||||
$(".page.pageLogin .login.side button").prop("disabled", false);
|
||||
}
|
||||
|
||||
export function disableSignInButton(): void {
|
||||
$(".page.pageLogin .login.side .button").addClass("disabled");
|
||||
$(".page.pageLogin .login.side button").prop("disabled", true);
|
||||
}
|
||||
|
||||
export function enableInputs(): void {
|
||||
|
@ -338,8 +338,9 @@ export const page = new Page(
|
|||
},
|
||||
async () => {
|
||||
Skeleton.append("pageLogin", "middle");
|
||||
$(".pageLogin .button").removeClass("disabled");
|
||||
$(".pageLogin input").prop("disabled", false);
|
||||
enableInputs();
|
||||
enableSignInButton();
|
||||
enableSignUpButton();
|
||||
},
|
||||
async () => {
|
||||
//
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
</div>
|
||||
<div class="login side">
|
||||
<div class="title">login</div>
|
||||
<div class="textButton" id="forgotPasswordButton">Forgot password?</div>
|
||||
<button class="text" id="forgotPasswordButton">Forgot password?</button>
|
||||
<form action="">
|
||||
<input
|
||||
name="current-email"
|
||||
|
@ -65,15 +65,15 @@
|
|||
<div>Remember me</div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="button signIn">
|
||||
<button type="submit" class="signIn">
|
||||
<i class="fas fa-sign-in-alt"></i>
|
||||
Sign In
|
||||
</div>
|
||||
</button>
|
||||
<div style="font-size: 0.75rem; text-align: center">or</div>
|
||||
<div class="button signInWithGoogle">
|
||||
<button class="signInWithGoogle">
|
||||
<i class="fab fa-google"></i>
|
||||
Google Sign In
|
||||
</div>
|
||||
</button>
|
||||
<!-- <div class="button signInWithGitHub">
|
||||
<i class="fab fa-github"></i>
|
||||
GitHub Sign In
|
||||
|
|
Loading…
Add table
Reference in a new issue