Ver código fonte

added mobile controls

tigger 5 meses atrás
pai
commit
0b81a7e7f3
3 arquivos alterados com 23 adições e 1 exclusões
  1. 7 0
      src/app/app.component.html
  2. 15 0
      src/app/app.component.ts
  3. 1 1
      src/dependencies/angularlib

+ 7 - 0
src/app/app.component.html

@@ -33,6 +33,7 @@
   @for (item of [
       {id:'home',icon:'home',link:'/',title:'Home',key:'home_page'},
       {id:'notifs',icon:'notifications',title:'Notifications',key:'notifs',menu:notifications},
+      {id:'chat'},
       {id:'user',icon:'account_circle',menu:userMenu,title:'User & Settings',key:'#{user} & #{settings}'}
     ]; track $index) {
       @switch (true) {
@@ -62,6 +63,12 @@
             }
           </div>
         }
+        @case (item.id === 'chat') {
+          <div id="{{item.id}}" class="toolbar-item" (click)="mobile.toggleChat()">
+            <mat-icon>chat</mat-icon>
+            <mat-label>{{('fis_ai_chat'|tr:'FIS A.I. Chat')}}</mat-label>
+          </div>
+        }
         @default {
           <div id="{{item.id}}" class="toolbar-item">
             <mat-icon>{{item.icon}}</mat-icon>

+ 15 - 0
src/app/app.component.ts

@@ -142,6 +142,7 @@ export class AppComponent extends BaseComponent implements OnInit {
       if (user) this.timeout.pipe(untilDestroy(this),takeUntil(this.loginService.loggedOut)).subscribe();
       this.subscribePushNotifications();
     });
+    if (this.cs.isMobileClient) this.mobile.init();
   }
 
   /**
@@ -203,4 +204,18 @@ export class AppComponent extends BaseComponent implements OnInit {
       this.leavePushNotif$ = undefined;
     }
   }
+
+  /**mobile controls */
+  protected mobile = {
+    /**init mobile controls */
+    init: () => {
+      const chatButton = document.getElementById('chat-toggle-button') as HTMLElement;
+      if (chatButton) chatButton.style.display = 'none';
+    },
+    /**toggle chat window */
+    toggleChat: () => {
+      const chat = document.getElementById('chat-panel') as HTMLElement;
+      if (chat) chat.style.display = chat.style.display === 'none' ? 'flex' : 'none';
+    }
+  }
 }

+ 1 - 1
src/dependencies/angularlib

@@ -1 +1 @@
-Subproject commit 7aea70f9ca36bf6b11e42e3f2c7ea394a2b6206c
+Subproject commit 9caa1da755ff09756615d28be5904bc075c35a39