Skip to content

Commit

Permalink
Merge pull request #74 from sparrowapp-dev/fix/login-ui-issues
Browse files Browse the repository at this point in the history
fix: login ui issues
  • Loading branch information
Astitva877 authored Nov 4, 2024
2 parents 518a590 + 403300d commit 675d3ca
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 21 deletions.
11 changes: 8 additions & 3 deletions src/pages/Auth/login-page/LoginPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
type="password"
autocomplete="off"
id="exampleInputPassword1"
placeholder="Please enter your Password"
placeholder="Please enter your password"
autocorrect="off"
autocapitalize="none"
bind:value={loginCredentials.password}
Expand All @@ -210,13 +210,14 @@
validationErrors = await handleLoginValidation(loginCredentials);
authenticationError = false;
}}
maxlength="32"
/>
<button
type="button"
on:click={togglePasswordVisibility}
class="border-0 position-absolute eye-icon d-flex align-items-center"
>
{#if isPasswordVisible}
{#if !isPasswordVisible}
<img src={eyeShow} alt="eye-show" />
{:else}
<img src={eyeHide} alt="eye-hie" />
Expand Down Expand Up @@ -258,8 +259,9 @@

<style>
.eye-icon {
top: 5px;
right: 5px;
top: 50%;
transform: translateY(-50%);
background-color: transparent;
}
Expand All @@ -275,4 +277,7 @@
input {
background-color: transparent !important;
}
input:disabled{
opacity: 0.5;
}
</style>
13 changes: 9 additions & 4 deletions src/pages/Auth/register-page/RegisterPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@
<p class="ms-1 mb-0 sparrow-fw-600 text-dangerColor">*</p></label
>
</div>
<div class="d-flex position-relative">
<div class="d-flex position-relative mt-1">
<input
class="form-control sparrow-fs-16 mt-1 pe-5 border:{validationErrors?.password &&
class="form-control sparrow-fs-16 pe-5 border:{validationErrors?.password &&
isPasswordTouched
? '3px'
: '1px'} solid {validationErrors?.password && isPasswordTouched
Expand All @@ -294,13 +294,14 @@
validationErrors = await handleRegisterValidation(userData);
validatePassword();
}}
maxlength="32"
/>
<button
type="button"
on:click={togglePasswordVisibility}
class=" border-0 position-absolute eye-icon d-flex align-items-center"
>
{#if isPasswordVisible}
{#if !isPasswordVisible}
<img src={eyeShow} alt="eye-show" />
{:else}
<img src={eyeHide} alt="eye-hie" />
Expand Down Expand Up @@ -406,8 +407,9 @@

<style>
.eye-icon {
top: 10px;
right: 5px;
top: 50%;
transform: translateY(-50%);
background-color: transparent;
}
input {
Expand All @@ -422,4 +424,7 @@
.btn-primary:active {
background: var(--button-pressed);
}
input:disabled{
opacity: 0.5;
}
</style>
15 changes: 10 additions & 5 deletions src/pages/Auth/reset-password/ResetPassword.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,14 @@

<div class="form-group mb-1 text-lightGray">
<div>
<label for="password" class="sparrow-fs-16 d-flex">New Password <p class="ms-1 mb-0 sparrow-fw-600 text-dangerColor">*</p></label>
<label for="password" class="sparrow-fs-16 d-flex">New Password
<p class="ms-1 mb-0 sparrow-fw-600 text-dangerColor">*</p>
</label>

</div>
<div class="d-flex position-relative">
<div class="d-flex position-relative mt-1">
<input
class="form-control mt-1 sparrow-fs-16 pe-5 border:{(!isPasswordValid1 || !isPasswordValid2 || !isPasswordValid3) &&
class="form-control sparrow-fs-16 pe-5 border:{(!isPasswordValid1 || !isPasswordValid2 || !isPasswordValid3) &&
isPasswordTouched
? '3px'
: '1px'} solid {(!isPasswordValid1 || !isPasswordValid2 || !isPasswordValid3) &&
Expand All @@ -137,13 +140,14 @@
validatePassword();
}}
on:input={validatePassword}
maxlength="32"
/>
<button
type="button"
on:click={togglePasswordVisibility}
class=" border-0 position-absolute eye-icon d-flex align-items-center"
>
{#if isPasswordVisible}
{#if !isPasswordVisible}
<img src={eyeShow} alt="eye-show" />
{:else}
<img src={eyeHide} alt="eye-hie" />
Expand Down Expand Up @@ -269,8 +273,9 @@
background: var(--primary-color);
}
.eye-icon {
top: 10px;
right: 5px;
top: 50%;
transform: translateY(-50%);
background-color: transparent;
}
input {
Expand Down
11 changes: 8 additions & 3 deletions src/pages/Auth/update-password/UpdatePassword.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@
notifications.success('Verification code sent successfully');
localStorage.setItem(`timer-${id}`, new Date().getTime());
startTimer();
verificationCode1 = '';
verificationCode2 = '';
verificationCode3 = '';
verificationCode4 = '';
verificationCode5 = '';
verificationCode6 = '';
onCodeInput();
} else {
notifications.error(response.message);
}
Expand Down Expand Up @@ -441,9 +448,7 @@
</div>
{#if verificationCodeError === true}
<small class="form-text text-dangerColor">
{errorMessage === 'Unauthorized Access'
? 'You have entered the wrong code. Please check again.'
: errorMessage}
{errorMessage}
</small>
{/if}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Auth/update-password/update-password.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const handleVerifyEmail = async (
navigate(`/reset/password/${verifyCodeCredential.email}/${response?.data}`);
} else {
isSuccessfulResponse.set(true);
if (response.message === "verificationCode should not be empty") {
if (response.message === "verificationCode should not be empty" || response.message === "verificationCode must be longer than or equal to 6 characters") {
errorMessageText.set("Please enter the 6-digit verification code.");
}

Expand Down
11 changes: 8 additions & 3 deletions src/pages/Auth/verify-email/VerifyEmail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@
notifications.success('Verification code sent successfully');
localStorage.setItem(`timer-verify-${id}`, new Date().getTime());
startTimer();
verificationCode1 = '';
verificationCode2 = '';
verificationCode3 = '';
verificationCode4 = '';
verificationCode5 = '';
verificationCode6 = '';
onCodeInput();
} else {
notifications.error(response.message);
}
Expand Down Expand Up @@ -469,9 +476,7 @@
</div>
{#if verificationCodeError === true}
<small class="form-text text-dangerColor">
{errorMessage === 'Unauthorized Access'
? 'You have entered the wrong code. Please check again.'
: errorMessage}
{errorMessage}
</small>
{/if}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Auth/verify-email/verify-email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export const handleVerifyUserEmail = async (verifyCodeCredential: verifyPostbody
errorMessageText.set("");
} else {
isSuccessfulResponse.set(true);
if (response.message === 'verificationCode should not be empty') {
if (response.message === 'verificationCode should not be empty' || response.message === "verificationCode must be longer than or equal to 6 characters") {
errorMessageText.set('Please enter the 6-digit verification code.');
}

if (response.message === 'Wrong Code') {
errorMessageText.set('You have entered wrong code, Please check again.');
errorMessageText.set('You have entered wrong code, please check your email.');
}
}
return response;
Expand Down

0 comments on commit 675d3ca

Please sign in to comment.