From 2fc8b6af48882cab378ab39f297526b7c783714f Mon Sep 17 00:00:00 2001
From: Kifungo A <45813955+adkif@users.noreply.github.com>
Date: Fri, 11 Oct 2024 12:23:59 +0200
Subject: [PATCH] fix: apply code rabbit suggestions
---
.../login-magic/login-magic.component.html | 3 +-
.../login-magic/login-magic.component.scss | 4 +-
.../login-magic/login-magic.component.ts | 10 +-
.../login-workspace.component.html | 6 +-
.../login-workspace.component.scss | 1 +
.../login-workspace.component.ts | 10 +-
.../src/lib/login/login.module.ts | 2 +-
.../ui/avatar/avatar.component.scss | 317 ++++++++----------
8 files changed, 152 insertions(+), 201 deletions(-)
diff --git a/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.html b/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.html
index 8af5440baa2..807f74de724 100644
--- a/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.html
+++ b/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.html
@@ -38,7 +38,6 @@
diff --git a/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.scss b/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.scss
index 036e8eee90e..a7192283a66 100644
--- a/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.scss
+++ b/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.scss
@@ -296,8 +296,8 @@ $button-color: #fa754e;
}
& .custom-btn {
- -webkit-box-shadow: 3px 11px 30px -17px #3366ff;
- box-shadow: 3px 11px 30px -17px #3366ff;
+ -webkit-box-shadow: 3px 11px 30px -17px nb-theme(color-primary-500);
+ box-shadow: 3px 11px 30px -17px nb-theme(color-primary-500);
width: auto;
padding: 13px 28px;
display: inline-flex;
diff --git a/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.ts b/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.ts
index ee74a809fd5..52059ce5d9f 100644
--- a/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.ts
+++ b/packages/desktop-ui-lib/src/lib/login/features/login-magic/login-magic.component.ts
@@ -1,5 +1,5 @@
import { ChangeDetectorRef, Component, Inject, OnInit } from '@angular/core';
-import { AbstractControl, FormBuilder, FormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
+import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { NB_AUTH_OPTIONS, NbAuthService, NbLoginComponent } from '@nebular/auth';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
@@ -59,7 +59,7 @@ export class NgxLoginMagicComponent extends NbLoginComponent implements OnInit {
}
constructor(
- private readonly _fb: UntypedFormBuilder,
+ private readonly _fb: FormBuilder,
private readonly _activatedRoute: ActivatedRoute,
public readonly nbAuthService: NbAuthService,
public readonly cdr: ChangeDetectorRef,
@@ -179,14 +179,12 @@ export class NgxLoginMagicComponent extends NbLoginComponent implements OnInit {
* Confirms the sign-in code.
*/
async confirmSignInCode(): Promise {
+ this.isLoading = true;
// Check if the form is invalid
if (this.form.invalid) {
this.isLoading = false;
return;
}
-
- this.isLoading = true;
-
// Get the email and code values from the form
const { email, code } = this.form.getRawValue();
@@ -211,6 +209,8 @@ export class NgxLoginMagicComponent extends NbLoginComponent implements OnInit {
* Starts a timer for a countdown.
*/
startTimer() {
+ this.stopTimer();
+
this.isCodeResent = true;
this.countdown = 30;
diff --git a/packages/desktop-ui-lib/src/lib/login/features/login-workspace/login-workspace.component.html b/packages/desktop-ui-lib/src/lib/login/features/login-workspace/login-workspace.component.html
index c28f00e21ee..2360ad8cb42 100644
--- a/packages/desktop-ui-lib/src/lib/login/features/login-workspace/login-workspace.component.html
+++ b/packages/desktop-ui-lib/src/lib/login/features/login-workspace/login-workspace.component.html
@@ -32,10 +32,6 @@ {{ 'WORKSPACES.SIGN_IN_TITLE' | translate }}