Doc comments on all modules, components, entities, helpers and type aliases; larger comments on the important entities (Dashboard, PlayerData, Context, App, Numput, item data). No behavior changes.
17 lines
437 B
Rust
17 lines
437 B
Rust
use crate::prelude::*;
|
|
use leptos::prelude::*;
|
|
|
|
/// Character portrait; hidden while no image URL is set.
|
|
#[component]
|
|
pub fn Image () -> impl IntoView {
|
|
let state = expect_context::<Context>();
|
|
let image = state.player().image();
|
|
view! {
|
|
<Show when=move || !image.get().is_empty() >
|
|
<div class="character-image">
|
|
<img src=move || image.get() />
|
|
</div>
|
|
</Show>
|
|
}
|
|
}
|