FarmMapsLib/projects/common/src/fm/components/notification-menu/notification-menu.component.ts

39 lines
912 B
TypeScript
Raw Normal View History

2021-04-12 13:52:42 +00:00
import { Component, OnInit, Input } from '@angular/core';
2021-02-11 10:44:34 +00:00
import { IUser } from '../../models/user';
import {Store} from '@ngrx/store';
import * as appReducers from '../../reducers/app-common.reducer';
import * as appActions from '../../actions/app-common.actions';
@Component({
selector: 'fm-notification-menu',
templateUrl: './notification-menu.component.html',
styleUrls: ['./notification-menu.component.scss']
})
2021-04-12 13:52:42 +00:00
export class NotificationMenuComponent implements OnInit {
2021-02-11 10:44:34 +00:00
@Input() unread:number;
@Input() user:IUser;
@Input() showMenu:boolean;
2023-03-06 13:04:14 +00:00
public noContent = true;
2021-02-11 10:44:34 +00:00
2021-04-12 13:52:42 +00:00
constructor(private store: Store<appReducers.State>) { }
2021-02-11 10:44:34 +00:00
ngOnInit(): void {
}
toggle(event:MouseEvent) {
event.stopPropagation();
this.store.dispatch(new appActions.ToggleNotificationMenu());
}
2021-04-12 13:52:42 +00:00
activateRoute() {
this.noContent=false;
}
deActivateRoute() {
this.noContent=true;
}
2021-02-11 10:44:34 +00:00
}