web: conditionally show spam button in catchup
This commit is contained in:
@@ -100,6 +100,7 @@ pub fn view(model: &Model) -> Node<Msg> {
|
||||
&catchup.items,
|
||||
is_loading,
|
||||
model.read_completion_ratio,
|
||||
true, // show spam button for email
|
||||
)
|
||||
} else {
|
||||
normal_view(
|
||||
@@ -127,6 +128,7 @@ pub fn view(model: &Model) -> Node<Msg> {
|
||||
&catchup.items,
|
||||
is_loading,
|
||||
model.read_completion_ratio,
|
||||
false, // no spam button for news
|
||||
)
|
||||
} else {
|
||||
normal_view(
|
||||
@@ -193,6 +195,7 @@ fn catchup_view(
|
||||
items: &[CatchupItem],
|
||||
is_loading: bool,
|
||||
read_completion_ratio: f64,
|
||||
show_spam_button: bool,
|
||||
) -> Node<Msg> {
|
||||
div![
|
||||
C!["w-full", "relative", "text-white"],
|
||||
@@ -268,14 +271,14 @@ fn catchup_view(
|
||||
Msg::GoToSearchResults
|
||||
]))
|
||||
],
|
||||
button![
|
||||
IF!(show_spam_button => button![
|
||||
tw_classes::button(),
|
||||
C!["text-red-500"],
|
||||
attrs! {At::Title => "Mark as spam"},
|
||||
span![i![C!["far", "fa-hand"]]],
|
||||
span![C!["pl-2"], "Spam"],
|
||||
ev(Ev::Click, |_| Msg::CatchupMarkAsSpam)
|
||||
],
|
||||
]),
|
||||
button![
|
||||
tw_classes::button_with_color("bg-green-800", "hover:bg-green-700"),
|
||||
span![i![C!["far", "fa-envelope-open"]]],
|
||||
|
||||
Reference in New Issue
Block a user