2024-07-20 21:10:06 +02:00
|
|
|
import "./messagePage.css";
|
|
|
|
|
|
2024-07-20 17:19:10 +02:00
|
|
|
import * as React from "bloatless-react";
|
|
|
|
|
|
|
|
|
|
import ChatViewModel from "../../ViewModel/chatViewModel";
|
2024-07-20 21:15:06 +02:00
|
|
|
import { translations } from "../translations";
|
2024-07-20 17:19:10 +02:00
|
|
|
|
|
|
|
|
export function MessagePage(chatViewModel: ChatViewModel) {
|
|
|
|
|
return (
|
2024-07-20 21:10:06 +02:00
|
|
|
<div id="message-page">
|
2024-07-20 17:19:10 +02:00
|
|
|
<div class="toolbar">
|
|
|
|
|
<span subscribe:innerText={chatViewModel.primaryChannel}></span>
|
|
|
|
|
</div>
|
2024-07-20 21:10:06 +02:00
|
|
|
<div class="content">
|
|
|
|
|
<div id="message-container"></div>
|
2024-07-20 21:15:06 +02:00
|
|
|
<div id="composer">
|
|
|
|
|
<input
|
|
|
|
|
bind:value={chatViewModel.composingMessage}
|
|
|
|
|
on:enter={chatViewModel.sendMessage}
|
|
|
|
|
placeholder={translations.chatPage.message.composerInputPlaceholder}
|
|
|
|
|
></input>
|
|
|
|
|
<button
|
|
|
|
|
class="primary"
|
|
|
|
|
aria-label={
|
|
|
|
|
translations.chatPage.message.sendMessageButtonAudioLabel
|
|
|
|
|
}
|
|
|
|
|
on:click={chatViewModel.sendMessage}
|
|
|
|
|
toggle:disabled={chatViewModel.cannotSendMessage}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">send</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2024-07-20 21:10:06 +02:00
|
|
|
</div>
|
2024-07-20 17:19:10 +02:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|