diff --git a/src/components/date.rs b/src/components/date.rs index 151e0e7..f2b7fb5 100644 --- a/src/components/date.rs +++ b/src/components/date.rs @@ -21,10 +21,20 @@ fn render_status(status: DateStatus) -> impl IntoView { DateStatus::Closed => "Closed", }; + let background_class = match status { + DateStatus::Upcoming => "bg-yellow-100 text-yellow-800 border-yellow-100", + DateStatus::Open => "bg-green-100 text-green-800 border-green-100", + DateStatus::Deadline | DateStatus::Closed => "bg-red-100 text-red-800 border-red-100", + }; + + let classes = + format!("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs + font-medium w-fit whitespace-nowrap shrink-0 {}", + background_class + ); + view! { - + {move || status_text} } @@ -54,8 +64,8 @@ fn Date( #[prop(into)] info: Signal, ) -> impl IntoView { view! { -
+
//
// icon //
diff --git a/src/pages/test_page.rs b/src/pages/test_page.rs index 2d16376..f288a7f 100644 --- a/src/pages/test_page.rs +++ b/src/pages/test_page.rs @@ -29,13 +29,12 @@ pub fn TestPage() -> impl IntoView { />
-
-
+
+

Important Dates

-
-
+
+