Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Sep 14, 2023
1 parent b774784 commit 1cbf984
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn ViewCheck(cx: Scope, check: Check) -> impl IntoView {
class="my-2 bg-white border-2 rounded-lg cursor-pointer hover:bg-primary-100 border-base-300"
>
<summary class="p-4 text-xl font-bold">
<ReportSummaryView green=(check.result == CheckResult::Green)/>
<CheckResultSummaryView green=(check.result == CheckResult::Green)/>
{" "}
{check.title}
</summary>
Expand Down Expand Up @@ -77,7 +77,7 @@ fn ViewCheck(cx: Scope, check: Check) -> impl IntoView {
}

#[component]
pub fn ReportSummaryView(cx: Scope, green: bool) -> impl IntoView {
pub fn CheckResultSummaryView(cx: Scope, green: bool) -> impl IntoView {
if green {
view! { cx, <span class="text-green-500">{"✓"}</span> }
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn Dashboard(cx: Scope) -> impl IntoView {
let healthy = Signal::derive(cx, move || {
data.with_result(|checks| {
checks
.into_iter()
.iter()
.all(|check| check.result == CheckResult::Green)
})
});
Expand All @@ -125,7 +125,7 @@ fn Dashboard(cx: Scope) -> impl IntoView {
{move || {
healthy
.with_result(move |green| {
view! { cx, <ReportSummaryView green=*green/> }
view! { cx, <CheckResultSummaryView green=*green/> }
})
}}

Expand Down

0 comments on commit 1cbf984

Please sign in to comment.