fix color on props

This commit is contained in:
Romulus21
2024-12-07 00:41:59 +01:00
parent 5342f91b6c
commit b8f94fa0d8
2 changed files with 3 additions and 2 deletions

View File

@@ -79,6 +79,7 @@ pub fn ValueCard(topic: String, location: String, sensor: String, unity: String,
#[component] #[component]
pub fn Card(sensor_props: ReadSignal<(String, String, String, String)>, value: Value) -> impl IntoView { pub fn Card(sensor_props: ReadSignal<(String, String, String, String)>, value: Value) -> impl IntoView {
let (location, sensor, unity, color) = sensor_props.get(); let (location, sensor, unity, color) = sensor_props.get();
let value_class = ["text-4xl flex ml-5 -my-2 text-center ", color.as_str()].join(" ");
view! { view! {
<div class="flex flex-col"> <div class="flex flex-col">
<div class="text-xl flex-1">{location}</div> <div class="text-xl flex-1">{location}</div>
@@ -86,7 +87,7 @@ pub fn Card(sensor_props: ReadSignal<(String, String, String, String)>, value: V
<div class="text-second-dark text-sm">{value.date_donnee}</div> <div class="text-second-dark text-sm">{value.date_donnee}</div>
</div> </div>
<h2 class="text-4xl flex ml-5 -my-2 text-center {color}"> <h2 class=value_class>
<strong>{value.donnee}</strong> <strong>{value.donnee}</strong>
<span class="text-2xl mt-5">{unity}</span> <span class="text-2xl mt-5">{unity}</span>
</h2> </h2>

View File

@@ -26,7 +26,7 @@ module.exports = {
green: "#00DA00", green: "#00DA00",
}, },
fontSize: { fontSize: {
"4xl": ["4rem", "1"], "4xl": ["4rem", "1.3"],
}, },
}, },
}, },