|
|
|
@ -35,12 +35,22 @@ enum Colorway {
|
|
|
|
|
|
|
|
|
|
#[component]
|
|
|
|
|
fn ResultMessage(cx: Scope, message: ReadSignal<Option<ResultMessageData>>) -> impl IntoView {
|
|
|
|
|
move || message().map(|ResultMessageData { title, message, colorway }| view! { cx,
|
|
|
|
|
<div class=class_list!["box", <Colorway as Into<&str>>::into(colorway)]>
|
|
|
|
|
<h3>{title}</h3>
|
|
|
|
|
<p>{message}</p>
|
|
|
|
|
</div>
|
|
|
|
|
})
|
|
|
|
|
let (open, set_open) = create_signal(cx, true);
|
|
|
|
|
create_effect(cx, move |_| {
|
|
|
|
|
message.track();
|
|
|
|
|
set_open(true);
|
|
|
|
|
});
|
|
|
|
|
move || view! { cx,
|
|
|
|
|
<Show when=move || open() fallback=|_| ()>
|
|
|
|
|
{move || message().map(|ResultMessageData { title, message, colorway }| view! { cx,
|
|
|
|
|
<div class=class_list!["box", <Colorway as Into<&str>>::into(colorway)] style="position: relative">
|
|
|
|
|
<strong class="block titlebar">{title}</strong>
|
|
|
|
|
<button class="iconbutton" on:click=move |_| set_open(false) style="position: absolute; bottom: 0.5em; right: 0.5em">"×"</button>
|
|
|
|
|
<p>{message}</p>
|
|
|
|
|
</div>
|
|
|
|
|
})}
|
|
|
|
|
</Show>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(From, IntoStaticStr)]
|
|
|
|
|