fix overlapping text and make game header take up less space

This commit is contained in:
Adam 2024-09-04 19:10:27 -04:00
parent 71bd306ffb
commit 912741acb4

View file

@ -6,12 +6,12 @@ fn Meta() -> impl IntoView {
let game_meta = expect_context::<ReadSignal<Option<GameMeta>>>(); let game_meta = expect_context::<ReadSignal<Option<GameMeta>>>();
view! { view! {
<span> <div class="shrink-0">
<p>Name: {move || game_meta().unwrap().name}</p> <p>{move || game_meta().unwrap().name}</p>
<p>White Deck: {move || game_meta().unwrap().white_count}</p> <p>"" {move || game_meta().unwrap().white_count}</p>
<p>White Discard: {move || game_meta().unwrap().white_discard_count}</p> <p>"" {move || game_meta().unwrap().black_count}</p>
<p>Black Deck: {move || game_meta().unwrap().black_count}</p> <p>"" {move || game_meta().unwrap().white_discard_count}</p>
</span> </div>
} }
} }
@ -21,8 +21,7 @@ fn Scoreboard() -> impl IntoView {
view! { view! {
<Show when=move || { game_meta().is_some() }> <Show when=move || { game_meta().is_some() }>
<span class="absolute top-0 right-0"> <table class="table-auto">
<table class="min-w-full table-auto">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
@ -59,7 +58,6 @@ fn Scoreboard() -> impl IntoView {
}) })
.collect_view()} .collect_view()}
</table> </table>
</span>
</Show> </Show>
} }
} }
@ -67,7 +65,7 @@ fn Scoreboard() -> impl IntoView {
#[component] #[component]
pub fn Header() -> impl IntoView { pub fn Header() -> impl IntoView {
view! { view! {
<div class="relative"> <div class="flex flex-wrap justify-between">
<Meta /> <Meta />
<Scoreboard /> <Scoreboard />
</div> </div>