diff --git a/src/app/components/contacts/contact-detail/contact-detail.component.html b/src/app/components/contacts/contact-detail/contact-detail.component.html
index 82efe8b..8065d24 100644
--- a/src/app/components/contacts/contact-detail/contact-detail.component.html
+++ b/src/app/components/contacts/contact-detail/contact-detail.component.html
@@ -112,7 +112,23 @@
- } @if (showMobileNavbar) {
-
+ } @if (isMobileNavbarVisible) {
+
+ @if(selectedUser!.isContactOnly || currentUser && selectedUser!.id ===
+ currentUser.id) {
+
+
+ {{ "contacts.btnEdit1" | translate }}
+
+
+ } @if (selectedUser!.isContactOnly || currentUser && selectedUser!.id !==
+ currentUser.id) {
+
+
+ {{ "contacts.btnDelete1" | translate }}
+
+
+ }
+
}
diff --git a/src/app/components/contacts/contact-detail/contact-detail.component.scss b/src/app/components/contacts/contact-detail/contact-detail.component.scss
index ccecb6a..50bd031 100644
--- a/src/app/components/contacts/contact-detail/contact-detail.component.scss
+++ b/src/app/components/contacts/contact-detail/contact-detail.component.scss
@@ -181,6 +181,44 @@
display: none;
}
+.mobile-nav {
+ position: fixed;
+ display: flex;
+ flex-direction: column;
+ bottom: 120px;
+ right: 80px;
+ width: 100px;
+ height: fit-content;
+ background-color: var(--bgSidebar);
+ border-radius: 20px 20px 0 20px;
+ box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.1);
+ padding: 10px;
+ z-index: 5;
+}
+
+.link {
+ display: flex;
+ align-items: center;
+ height: 46px;
+ padding: 8px 16px;
+ border-radius: 8px;
+ color: var(--white);
+ cursor: pointer;
+ span {
+ width: 118px;
+ text-align: center;
+ word-wrap: break-word;
+ overflow-wrap: break-word;
+ white-space: normal;
+ }
+ &:hover {
+ background-color: var(--very-dark-blue);
+ span {
+ color: var(--light-blue);
+ }
+ }
+}
+
/*------------- ANIMATION -------------*/
.animation-coming-in {
diff --git a/src/app/components/contacts/contact-detail/contact-detail.component.ts b/src/app/components/contacts/contact-detail/contact-detail.component.ts
index 7fc3f34..7ef1f91 100644
--- a/src/app/components/contacts/contact-detail/contact-detail.component.ts
+++ b/src/app/components/contacts/contact-detail/contact-detail.component.ts
@@ -1,6 +1,7 @@
import {
Component,
EventEmitter,
+ HostListener,
Input,
OnChanges,
OnDestroy,
@@ -31,8 +32,7 @@ export class ContactDetailComponent implements OnChanges, OnDestroy {
selectedUser: User | null = null;
isLoading = false;
- showMobileNavbar = false;
- showConfirmDialog = false;
+ isMobileNavbarVisible = false;
private destroy$ = new Subject();
@@ -102,15 +102,7 @@ export class ContactDetailComponent implements OnChanges, OnDestroy {
* Toggles the visibility of the mobile contact details navbar.
*/
toggleNav(): void {
- this.showMobileNavbar = !this.showMobileNavbar;
- }
-
- /**
- * Toggles the visibility of the confirmation dialog.
- * This method switches the `showConfirmDialog` boolean state.
- */
- toggleConfirmDialog(): void {
- this.showConfirmDialog = !this.showConfirmDialog;
+ this.isMobileNavbarVisible = !this.isMobileNavbarVisible;
}
/**
@@ -121,7 +113,7 @@ export class ContactDetailComponent implements OnChanges, OnDestroy {
*/
editContact(userData: User) {
this.overlayService.setOverlayData('contactOverlay', userData);
- this.showMobileNavbar = false;
+ this.isMobileNavbarVisible = false;
}
/**
@@ -138,4 +130,19 @@ export class ContactDetailComponent implements OnChanges, OnDestroy {
console.error(error);
}
}
+
+ @HostListener('document:click', ['$event'])
+ /**
+ * Closes the mobile navbar if the user clicks outside of it.
+ * @param event - A MouseEvent from the document.
+ */
+ closeNavbarOnOutsideClick(event: MouseEvent): void {
+ const clickedElement = event.target as HTMLElement;
+ if (
+ !clickedElement.closest('mobile-nav') &&
+ !clickedElement.closest('.btn-mobile')
+ ) {
+ this.isMobileNavbarVisible = false;
+ }
+ }
}