diff --git a/client/src/components/game/header.rs b/client/src/components/game/header.rs index bf4f1cd..6ecfbe4 100644 --- a/client/src/components/game/header.rs +++ b/client/src/components/game/header.rs @@ -9,7 +9,6 @@ fn Meta() -> impl IntoView {

Name: {move || game_meta().unwrap().name}

Host: {move || game_meta().unwrap().host}

-

Czar: {move || game_meta().unwrap().czar}

White Deck: {move || game_meta().unwrap().white_count}

White Discard: {move || game_meta().unwrap().white_discard_count}

Black Deck: {move || game_meta().unwrap().black_count}

@@ -20,6 +19,13 @@ fn Meta() -> impl IntoView { #[component] fn Scoreboard() -> impl IntoView { let game_meta = expect_context::>>(); + let (czar_name, set_czar_name) = create_signal("".to_string()); + + create_effect(move |_| { + if let Some(meta) = game_meta() { + set_czar_name(meta.czar) + } + }); view! { @@ -35,14 +41,18 @@ fn Scoreboard() -> impl IntoView { {game_meta() .unwrap() .players - .iter() + .into_iter() .map(|player| { view! { - {&player.name} - {player.score} + {if game_meta().unwrap().czar == player.name { + "👑 " + } else { + "" + }} {player.name} + {player.score} } })