11import { Component , Element , Fragment , h } from '@stencil/core' ;
22
3- import navStore from '../../../stores/nav.store' ;
43import authStore from '../../../stores/auth.store' ;
5- import { NavDirection } from '../../../stores/nav.store' ;
64import i18n from '../../../stores/i18n.store' ;
75
8- import { signIn } from '../../../utils/core/signin.utils' ;
9-
10- import { AuthService } from '../../../services/auth/auth.service' ;
11-
12- import { AppIcon } from '../app-icon/app-icon' ;
6+ import { AppIcon } from '../app-icon/app-icon' ;
137
148@Component ( {
159 tag : 'app-menu' ,
@@ -19,25 +13,6 @@ import { AppIcon } from '../app-icon/app-icon';
1913export class AppMenu {
2014 @Element ( ) el : HTMLElement ;
2115
22- private authService : AuthService ;
23-
24- constructor ( ) {
25- this . authService = AuthService . getInstance ( ) ;
26- }
27-
28- private async signIn ( ) {
29- signIn ( ) ;
30- }
31-
32- private async signOut ( ) {
33- await this . authService . signOut ( ) ;
34-
35- navStore . state . nav = {
36- url : '/' ,
37- direction : NavDirection . RELOAD
38- } ;
39- }
40-
4116 render ( ) {
4217 return (
4318 < ion-list >
@@ -47,8 +22,6 @@ export class AppMenu {
4722 { this . renderSettings ( ) }
4823
4924 { this . renderInteract ( ) }
50-
51- { this . renderSignInOut ( ) }
5225 </ ion-list >
5326 ) ;
5427 }
@@ -74,24 +47,6 @@ export class AppMenu {
7447 ) ;
7548 }
7649
77- private renderSignInOut ( ) {
78- if ( authStore . state . loggedIn ) {
79- return (
80- < ion-item button class = "signout" onClick = { ( ) => this . signOut ( ) } >
81- < AppIcon name = "log-out" ariaLabel = "" ariaHidden = { true } lazy = { true } slot = "start" style = { { transform : 'translate(3px, 0px)' } } > </ AppIcon >
82- < ion-label > { i18n . state . nav . sign_out } </ ion-label >
83- </ ion-item >
84- ) ;
85- } else {
86- return (
87- < ion-item button onClick = { ( ) => this . signIn ( ) } >
88- < AppIcon name = "log-in" ariaLabel = "" ariaHidden = { true } lazy = { true } slot = "start" style = { { transform : 'translate(-3px, 0px)' } } > </ AppIcon >
89- < ion-label > { i18n . state . nav . sign_in } </ ion-label >
90- </ ion-item >
91- ) ;
92- }
93- }
94-
9550 private renderInteract ( ) {
9651 return (
9752 < Fragment >
0 commit comments