refactor(style): update chat layout and scrolling
This commit is contained in:
24
frontend/src/components/chatSidebarStore.ts
Normal file
24
frontend/src/components/chatSidebarStore.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import Alpine from 'alpinejs';
|
||||
|
||||
const COLLAPSED_KEY = 'aethera-chat-sidebar-collapsed';
|
||||
|
||||
interface ChatSidebarStore {
|
||||
mobileOpen: boolean;
|
||||
collapsed: boolean;
|
||||
toggleMobile(): void;
|
||||
toggleCollapsed(): void;
|
||||
}
|
||||
|
||||
const store: ChatSidebarStore = {
|
||||
mobileOpen: false,
|
||||
collapsed: localStorage.getItem(COLLAPSED_KEY) === 'true',
|
||||
toggleMobile() {
|
||||
this.mobileOpen = !this.mobileOpen;
|
||||
},
|
||||
toggleCollapsed() {
|
||||
this.collapsed = !this.collapsed;
|
||||
localStorage.setItem(COLLAPSED_KEY, String(this.collapsed));
|
||||
},
|
||||
};
|
||||
|
||||
Alpine.store('chatSidebar', store);
|
||||
Reference in New Issue
Block a user