improve ribbon

This commit is contained in:
marlon-erler
2024-07-20 16:28:00 +02:00
parent c1b7dc46dd
commit e27c360395
7 changed files with 205 additions and 41 deletions
+16 -2
View File
@@ -12,6 +12,10 @@ export default class ChatViewModel {
primaryChannel: React.State<string> = new React.State("");
primaryChannelInput: React.State<string> = new React.State("");
selectedPage: React.State<ChatPageType> = new React.State<ChatPageType>(
ChatPageType.Messages
);
// guards
cannotSetPrimaryChannel: React.State<boolean> = React.createProxyState(
[this.primaryChannel, this.primaryChannelInput],
@@ -23,11 +27,11 @@ export default class ChatViewModel {
// methods
open = () => {
this.chatListViewModel.openChat(this);
}
};
close = () => {
this.chatListViewModel.closeChat();
}
};
// init
constructor(chatListViewModel: ChatListViewModel, chatModel: ChatModel) {
@@ -38,3 +42,13 @@ export default class ChatViewModel {
this.primaryChannelInput.value = chatModel.info.primaryChannel;
}
}
// types
export enum ChatPageType {
Settings,
Messages,
AllObjects,
Kanban,
Calendar,
Progress,
}