From 3f5e92eea9250049845aabf6bd2b7e7600f0e350 Mon Sep 17 00:00:00 2001 From: Chneemann Date: Mon, 1 Apr 2024 20:25:28 +0200 Subject: [PATCH] style & bugfixes --- angular.json | 35 ++++++------------- src/app/app.component.ts | 6 +--- .../contact-form/contact-form.component.ts | 1 - src/app/services/user.service.ts | 2 +- src/styles.scss | 4 +++ 5 files changed, 16 insertions(+), 32 deletions(-) diff --git a/angular.json b/angular.json index 9d4c0d2..c61660d 100644 --- a/angular.json +++ b/angular.json @@ -20,18 +20,11 @@ "outputPath": "dist/join", "index": "src/index.html", "browser": "src/main.ts", - "polyfills": [ - "zone.js" - ], + "polyfills": ["zone.js"], "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.scss" - ], + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/styles.scss"], "scripts": [] }, "configurations": { @@ -39,13 +32,13 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" + "maximumWarning": "1mb", + "maximumError": "2mb" }, { "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" + "maximumWarning": "4kb", + "maximumError": "8kb" } ], "outputHashing": "all" @@ -79,19 +72,11 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "polyfills": [ - "zone.js", - "zone.js/testing" - ], + "polyfills": ["zone.js", "zone.js/testing"], "tsConfig": "tsconfig.spec.json", "inlineStyleLanguage": "scss", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.scss" - ], + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/styles.scss"], "scripts": [] } } diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4385c91..8d28f01 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -7,7 +7,6 @@ import { SidebarMobileComponent } from './shared/components/sidebar/sidebar-mobi import { ContactEditComponent } from './components/contacts/contact-edit/contact-edit.component'; import { CommonModule } from '@angular/common'; import { SharedService } from './services/shared.service'; -import { Observable } from 'rxjs'; import { ContactDeleteComponent } from './components/contacts/contact-delete/contact-delete.component'; @Component({ @@ -40,9 +39,6 @@ export class AppComponent { } getUserIdInLocalStorage() { - localStorage.setItem( - 'currentUserId', - JSON.stringify('5EX7gnwPPGEDbN186Rdw') - ); + localStorage.setItem('currentUser', JSON.stringify('5EX7gnwPPGEDbN186Rdw')); } } diff --git a/src/app/components/contacts/contact-form/contact-form.component.ts b/src/app/components/contacts/contact-form/contact-form.component.ts index 33e88ef..5acc5ef 100644 --- a/src/app/components/contacts/contact-form/contact-form.component.ts +++ b/src/app/components/contacts/contact-form/contact-form.component.ts @@ -57,7 +57,6 @@ export class ContactFormComponent implements OnChanges { } deleteContact() { - this.userService.deleteUser(this.currentUserId); this.sharedService.isDeleteContactDialogOpen = false; this.sharedService.isAnyDialogOpen = false; } diff --git a/src/app/services/user.service.ts b/src/app/services/user.service.ts index f3c4218..818bdaf 100644 --- a/src/app/services/user.service.ts +++ b/src/app/services/user.service.ts @@ -41,7 +41,7 @@ export class UserService implements OnDestroy { getCurrentUserId() { let currentUser = localStorage.getItem('currentUser'); if (currentUser !== null) { - return JSON.parse(currentUser)[0].id; + return JSON.parse(currentUser); } } diff --git a/src/styles.scss b/src/styles.scss index 285d9d1..dab2f74 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -4,6 +4,10 @@ font-family: "Inter", sans-serif; } +body { + background-color: var(--bgContent); +} + :root { --bgSidebar: #2b3647; --bgContent: #f6f7f8;