web: make +6 month button work from post date
This commit is contained in:
parent
c0982e82c6
commit
2aa85a03f8
@ -739,7 +739,7 @@ fn render_open_header(msg: &ShowThreadQueryThreadOnEmailThreadMessages) -> Node<
|
|||||||
" ",
|
" ",
|
||||||
from_detail.as_ref().map(|text| copy_text_widget(&text))
|
from_detail.as_ref().map(|text| copy_text_widget(&text))
|
||||||
],
|
],
|
||||||
snooze_buttons(&id),
|
snooze_buttons(msg.timestamp, &id),
|
||||||
],
|
],
|
||||||
IF!(!msg.to.is_empty() =>div![
|
IF!(!msg.to.is_empty() =>div![
|
||||||
C!["text-xs"],
|
C!["text-xs"],
|
||||||
@ -1603,7 +1603,7 @@ fn render_news_post_header(post: &ShowThreadQueryThreadOnNewsPost) -> Node<Msg>
|
|||||||
div![
|
div![
|
||||||
C!["flex"],
|
C!["flex"],
|
||||||
div![C!["font-semibold", "text-sm", "flex-1"], from],
|
div![C!["font-semibold", "text-sm", "flex-1"], from],
|
||||||
snooze_buttons(&id),
|
snooze_buttons(Some(post.timestamp), &id),
|
||||||
],
|
],
|
||||||
div![
|
div![
|
||||||
C!["flex", "gap-2", "pt-2", "text-sm"],
|
C!["flex", "gap-2", "pt-2", "text-sm"],
|
||||||
@ -1700,7 +1700,7 @@ fn click_to_top() -> Node<Msg> {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
fn snooze_buttons(id: &str) -> Node<Msg> {
|
fn snooze_buttons(timestamp: Option<i64>, id: &str) -> Node<Msg> {
|
||||||
div![
|
div![
|
||||||
span![C!["px-2"], "⏰"],
|
span![C!["px-2"], "⏰"],
|
||||||
button![
|
button![
|
||||||
@ -1727,17 +1727,19 @@ fn snooze_buttons(id: &str) -> Node<Msg> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
button![
|
timestamp.map(
|
||||||
|
|ts| chrono::DateTime::from_timestamp(ts, 0).map(|ts| button![
|
||||||
tw_classes::button(),
|
tw_classes::button(),
|
||||||
C!["rounded-l-none"],
|
C!["rounded-l-none"],
|
||||||
"6m",
|
"+6m",
|
||||||
ev(Ev::Click, {
|
ev(Ev::Click, {
|
||||||
let id = id.to_string();
|
let id = id.to_string();
|
||||||
move |e| {
|
move |e| {
|
||||||
e.stop_propagation();
|
e.stop_propagation();
|
||||||
Msg::Snooze(id, Utc::now() + chrono::Days::new(180))
|
Msg::Snooze(id, ts + chrono::Days::new(180))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
])
|
||||||
|
),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user