Display messages on the bottom of the message div

This commit is contained in:
pjht 2024-10-08 21:20:59 -05:00
parent c4caac3a21
commit fdd10f7065
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E
2 changed files with 4 additions and 4 deletions

View File

@ -123,11 +123,11 @@ impl Component for Home {
} }
<div <div
ref={self.message_container_ref.clone()} ref={self.message_container_ref.clone()}
class="border rounded flex-grow-1 overflow-auto mb-3" class="d-flex border rounded flex-grow-1 flex-column-reverse overflow-auto mb-3"
style="flex-basis: 0" style="flex-basis: 0"
> >
{ self.messages.iter().map(|msg| html!{ { self.messages.iter().rev().map(|msg| html!{
<div class="d-flex justify-content-between align-items-start mb-2"> <div class="d-flex justify-content-between align-items-start">
<div class="me-2">{msg.message.clone()}</div> <div class="me-2">{msg.message.clone()}</div>
<div class="me-2 text-nowrap">{msg.time.format("%I:%M:%S %p").to_string()}</div> <div class="me-2 text-nowrap">{msg.time.format("%I:%M:%S %p").to_string()}</div>
</div>} </div>}

View File

@ -6,4 +6,4 @@ pushd frontend
trunk build trunk build
popd popd
cargo run --bin server --release -- --port 8080 --static-dir ./dist cargo run --bin server --release -- --port 8080 --addr :: --static-dir ./dist