Skip to content

Commit 3dc1299

Browse files
committed
make sure dropdown with events lists disappears upon emptying
1 parent ede668b commit 3dc1299

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

risuto-web/scss/style.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ $primary: $red;
4141
transform: scale(0);
4242
}
4343

44+
.events-pending-list.no-events {
45+
display: none;
46+
}
47+
4448
.task-list li {
4549
background-color: $gray-900;
4650
color: $body-color;

risuto-web/src/ui/main_view.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ pub fn main_view(p: &MainViewProps) -> Html {
116116
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
117117
<span class="visually-hidden">{ "Submitting events..." }</span>
118118
</button>
119-
<ul class="dropdown-menu dropdown-menu-dark">
119+
<ul class={ classes!(
120+
"events-pending-list",
121+
p.events_pending_submission.is_empty().then(|| "no-events"),
122+
"dropdown-menu", "dropdown-menu-dark"
123+
) }>
120124
{ for p.events_pending_submission.iter().map(|e| html! {
121125
<li>{ format!("{:?}", e) }</li> // TODO: make events prettier
122126
}) }

0 commit comments

Comments
 (0)