create separate component for home page buttons

This commit is contained in:
marlon-erler
2026-04-08 20:31:25 +00:00
parent 12c77979bf
commit ca674e16fa
12 changed files with 94 additions and 75 deletions
+13 -6
View File
@@ -119,7 +119,6 @@ export default class ChatModel {
this.storageModel.writeStringifiable(reactionPath, reaction);
}
this.reactionHandlerManager.trigger(reaction);
};
handleMessageSent = (chatMessage: ChatMessage): void => {
@@ -417,7 +416,11 @@ export default class ChatModel {
const fileContent = FileModel.createFileContent(v4(), "reaction");
const reaction: ChatMessageReaction = {
...fileContent,
fileId: ChatModel.createMessageReactionId(messageId, content, sender),
fileId: ChatModel.createMessageReactionId(
messageId,
content,
sender,
),
messageId,
sender,
@@ -427,9 +430,13 @@ export default class ChatModel {
return reaction;
};
static createMessageReactionId = (messageId: string, content: ReactionSymbols, sender: string): string => {
static createMessageReactionId = (
messageId: string,
content: ReactionSymbols,
sender: string,
): string => {
return messageId + sender + reactionStringMap[content];
}
};
}
// types
@@ -442,8 +449,8 @@ export enum ReactionSymbols {
Question = "❓",
}
const reactionStringMap: {[key: ReactionSymbols|string]: string} = {}
Object.entries(ReactionSymbols).forEach(value => {
const reactionStringMap: { [key: ReactionSymbols | string]: string } = {};
Object.entries(ReactionSymbols).forEach((value) => {
reactionStringMap[value[1]] = value[0];
});