temp: pc change (add server function and date comparison)
This commit is contained in:
1 parent
6fdf7f0113
commit
9eacc9a618
2 files changed
+19
-10
No files matched your search
+15
-5
@@ -21,10 +21,20 @@ fn render_status(status: DateStatus) -> impl IntoView {
|
|||||||
DateStatus::Closed => "Closed",
|
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! {
|
view! {
|
||||||
<span class="inline-flex items-center justify-center rounded-md border border-yellow-100
|
<span class=classes>
|
||||||
bg-yellow-100 px-2 py-0.5 text-xs text-yellow-800 font-medium w-fit whitespace-nowrap
|
|
||||||
shrink-0">
|
|
||||||
{move || status_text}
|
{move || status_text}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@@ -54,8 +64,8 @@ fn Date(
|
|||||||
#[prop(into)] info: Signal<DateInfo>,
|
#[prop(into)] info: Signal<DateInfo>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
view! {
|
view! {
|
||||||
<div class="dashboard-button flex items-start gap-3 rounded-lg border-grey-300 p-3
|
<div class="flex items-start gap-3 rounded-lg border-grey-300 p-3
|
||||||
w-full text-left shadow-[inset_0_0_6px_rgba(0,0,0,0.12)]">
|
w-full text-left shadow-lg">
|
||||||
// <div class="flex-shrink-0 mt-0.5">
|
// <div class="flex-shrink-0 mt-0.5">
|
||||||
// <img src={icon} class="h-4 w-4" alt="icon"/>
|
// <img src={icon} class="h-4 w-4" alt="icon"/>
|
||||||
// </div>
|
// </div>
|
||||||
|
|||||||
@@ -29,13 +29,12 @@ pub fn TestPage() -> impl IntoView {
|
|||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
<section class="space-y-2">
|
<section class="space-y-2">
|
||||||
<div class="rounded-lg shadow-lg overflow-hidden">
|
<div class="rounded-lg shadow-lg/25 overflow-hidden">
|
||||||
<div class="bg-red-900 text-white px-4 py-3 shadow-lg \
|
<div class="bg-red-900 text-white px-4 py-3 shadow-lg">
|
||||||
shadow-[inset_0_2px_4px_0_rgba(0,0,0,0.3)">
|
|
||||||
<h3 class="text-white font-bold">Important Dates</h3>
|
<h3 class="text-white font-bold">Important Dates</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-6 space-y-6">
|
<div class="p-2">
|
||||||
<div class="bg-white rounded-md p-3 space-y-2">
|
<div class="flex flex-col p-3 gap-3">
|
||||||
<DateList
|
<DateList
|
||||||
dates=vec![
|
dates=vec![
|
||||||
DateInfo {
|
DateInfo {
|
||||||
|
|||||||
Reference in new issue
Block a user