CI / Build and push docker image (push) Failing after 39s
The lobby was hand-rolled CSS and looked plain. Vendor Bootstrap 5.3 (MIT) under web/vendor so builds stay offline, load it in dark mode and bridge the felt/gold palette onto Bootstrap's CSS variables in a new theme.css; style.css now only owns the game table, cards and scoring summary. Rebuild the lobby, waiting room and shared chrome with Bootstrap components: a shared navbar, creation form as cards with schema-driven controls, roster as a list group with seat/team badges, a seats progress bar and a copy-to-clipboard button on the join code. History, leaderboard, connection/error states and the 404 page use cards, tables and buttons too; the play table itself is unchanged. The copy feedback timer is cancelled when the waiting room is rebuilt by another player joining, fixing a disposed-signal panic that froze the page mid-match.
21 lines
711 B
Rust
21 lines
711 B
Rust
//! Auto-dismissing error toast.
|
|
use gloo_timers::callback::Timeout;
|
|
use sycamore::prelude::*;
|
|
|
|
const TOAST_MS: u32 = 10_000;
|
|
|
|
/// Renders the error from `error` as a toast; hides it after `TOAST_MS`.
|
|
/// A new error replaces the message and restarts the timer.
|
|
pub fn toast(error: Signal<Option<String>>) -> View {
|
|
create_effect(move || {
|
|
if error.get_clone().is_some() {
|
|
// Held until cleanup; dropped (cancelled) when the effect re-runs.
|
|
let timeout = Timeout::new(TOAST_MS, move || error.set(None));
|
|
on_cleanup(move || drop(timeout));
|
|
}
|
|
});
|
|
view! {
|
|
(move || error.get_clone().map(|e| view! { div(class="app-toast") { (e) } }))
|
|
}
|
|
}
|