diff --git a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts
index 9cb0c148..62bd02b2 100644
--- a/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts
+++ b/projects/ucap-webmessenger-app/src/app/pages/messenger/components/main.page.component.ts
@@ -5,7 +5,8 @@ import {
Inject,
OnDestroy,
ViewChild,
- NgZone
+ NgZone,
+ ElementRef
} from '@angular/core';
import { Store, select } from '@ngrx/store';
@@ -48,6 +49,7 @@ import { MessageType } from '@ucap-webmessenger/api-message';
import { AppUserInfo, KEY_APP_USER_INFO } from '@app/types/app-user-info.type';
import { environment } from '../../../../environments/environment';
import { TranslateService } from '@ngx-translate/core';
+import { LeftSideComponent } from '@app/layouts/messenger/components/left-side.component';
@Component({
selector: 'app-page-messenger-main',
@@ -55,8 +57,12 @@ import { TranslateService } from '@ngx-translate/core';
styleUrls: ['./main.page.component.scss']
})
export class MainPageComponent implements OnInit, OnDestroy {
- @ViewChild('rightDrawer', { static: true }) rightDrawer: MatDrawer;
- @ViewChild('leftSideDrawer', { static: true }) leftSideDrawer: MatDrawer;
+ @ViewChild('rightDrawer', { static: true })
+ rightDrawer: MatDrawer;
+ @ViewChild('leftSideDrawer', { static: true })
+ leftSideDrawer: MatDrawer;
+ @ViewChild('leftSideContainer', { static: false })
+ leftSideContainer: LeftSideComponent;
selectedChat$: Observable;
selectedRightDrawer$: Observable;
@@ -455,4 +461,31 @@ export class MainPageComponent implements OnInit, OnDestroy {
this.onLeftDrawerIndicator = false;
}
}
+
+ onMouseEnterLeftSideContainer(event: MouseEvent) {
+ const rect = this.leftSideContainer.elementRef.nativeElement.getBoundingClientRect();
+
+ const minX = rect.left + rect.width - 10;
+ const maxX = rect.left + rect.width;
+ const minY = rect.top;
+ const maxY = rect.top + rect.height;
+
+ if (
+ event.pageX >= minX &&
+ event.pageX <= maxX &&
+ event.pageY >= minY &&
+ event.pageY <= maxY
+ ) {
+ this.logger.debug('mouseOver edge of container');
+ this.store.dispatch(
+ ChatStore.toggleLeftSideDrawerIndicator({ show: true })
+ );
+ }
+ }
+
+ onMouseLeaveLeftSideContainer(event: MouseEvent) {
+ this.store.dispatch(
+ ChatStore.toggleLeftSideDrawerIndicator({ show: false })
+ );
+ }
}