Skip to content

Commit

Permalink
tips when filters are turned on
Browse files Browse the repository at this point in the history
  • Loading branch information
YilunAllenChen committed Nov 7, 2023
1 parent ee3cef0 commit 71db71f
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/pages/hall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ impl Component for HallComponent {
})
.collect::<Vec<Html>>();

let tips = match articles.len() {
0 => html! {
<div class="my-20 mx-12 text-center text-gray-300 space-y-4">
<p>{"This room seems to be empty 🤔..."}</p>
<p>{"Did you forget to clear your filter (🏷️)?"}</p>
</div>
},
_ => html! {
<div class="my-20 mx-12 text-center text-gray-300 space-y-4">
<p>{"You've reached the end of the this room."}</p>
<p>{"Hope you enjoyed your visit!"}</p>
<p>{"If you want to see more, check out the other halls (🏛️)!"}</p>
</div>
},
};

let emitter = ctx.link().clone();
let nav_cb = Callback::from(move |msg| emitter.send_message(msg));

Expand Down Expand Up @@ -169,11 +185,7 @@ impl Component for HallComponent {
{articles}
</ul>

<div class="my-20 mx-12 text-center text-gray-300 space-y-4">
<p>{"You've reached the end of the this room."}</p>
<p>{"Hope you enjoyed your visit!"}</p>
<p>{"If you want to see more, check out the other halls (🏛️)!"}</p>
</div>
{tips}

<div class="mt-36 mb-20 text-center text-gray-600">
{"Museum of Code © 2023, All Rights Reserved"}
Expand Down

0 comments on commit 71db71f

Please sign in to comment.