Skip to content

Commit 9877ce0

Browse files
committed
subhead
1 parent 826aac2 commit 9877ce0

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/client_events/_card.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
<div class="header">
77
<div class="title">{ icon } { title }</div>
88
</div>
9+
<div class="subhead">{ subhead }</div>
910
</div>
1011
</div>

src/client_events/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ use serde_json::Value;
44
const CARD_HTML: &str = include_str!("_card.html");
55

66
pub fn render_event_card(event: &EventSave) -> String {
7-
let details: Value = serde_json::from_slice(&event.details).unwrap();
7+
let mut details: Value = serde_json::from_slice(&event.details).unwrap();
8+
let subhead = details
9+
.as_object_mut()
10+
.and_then(|d| d.remove(""))
11+
.and_then(|v| v.as_str().map(|v| v.to_string()))
12+
.unwrap_or_default();
13+
814
let details = serde_json::to_string_pretty(&details).unwrap();
915
let details = BASE64_STANDARD.encode(&details);
1016

@@ -20,6 +26,7 @@ pub fn render_event_card(event: &EventSave) -> String {
2026
.replace("{ title }", &event.event)
2127
.replace("{ details }", &details)
2228
.replace("{ bg }", &bg)
29+
.replace("{ subhead }", &subhead)
2330
}
2431

2532
use xmtp_proto::xmtp::device_sync::event_backup::EventSave;

src/client_events/styles.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ button:active {
321321
.status-card {
322322
background: rgba(255, 255, 255, 0.95);
323323
backdrop-filter: blur(20px);
324+
cursor: pointer;
324325
border-radius: 5px;
325326
padding: 5px;
326327
box-shadow:
@@ -344,6 +345,10 @@ button:active {
344345
.header {
345346
text-align: center;
346347
}
348+
.subhead {
349+
color: #777;
350+
font-size: 12px;
351+
}
347352

348353
.title {
349354
font-size: 0.75rem;

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ async fn main() -> Result<()> {
213213

214214
cleanup::spawn_cleanup_worker();
215215

216-
let host = "0.0.0.0:5559";
216+
let host = "0.0.0.0:5558";
217217
println!("Starting server at: {host}");
218218
HttpServer::new(move || {
219219
let cors = Cors::default()

0 commit comments

Comments
 (0)