diff --git a/Cargo.lock b/Cargo.lock index e7dbcd8..ac55f09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2477,7 +2477,7 @@ dependencies = [ [[package]] name = "nostrdb" version = "0.3.4" -source = "git+https://github.com/damus-io/nostrdb-rs?rev=6d22af6d5159be4c9e4579f8c9d3af836e0d470a#6d22af6d5159be4c9e4579f8c9d3af836e0d470a" +source = "git+https://github.com/damus-io/nostrdb-rs?rev=9bbafd8a2e904b77a51e7cfca71eb5bb5650e829#9bbafd8a2e904b77a51e7cfca71eb5bb5650e829" dependencies = [ "bindgen", "cc", diff --git a/Cargo.toml b/Cargo.toml index d861e5b..75404f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ serde_derive = "1" serde = { version = "1", features = ["derive"] } # You only need this if you want app persistence tracing = "0.1.40" #wasm-bindgen = "0.2.83" -nostrdb = { git = "https://github.com/damus-io/nostrdb-rs", rev = "6d22af6d5159be4c9e4579f8c9d3af836e0d470a" } +nostrdb = { git = "https://github.com/damus-io/nostrdb-rs", rev = "9bbafd8a2e904b77a51e7cfca71eb5bb5650e829" } #nostrdb = { path = "/Users/jb55/dev/github/damus-io/nostrdb-rs" } #nostrdb = "0.3.4" enostr = { path = "enostr" } diff --git a/enostr/Cargo.toml b/enostr/Cargo.toml index 30b705d..4b74228 100644 --- a/enostr/Cargo.toml +++ b/enostr/Cargo.toml @@ -11,7 +11,7 @@ serde_derive = "1" serde = { version = "1", features = ["derive"] } # You only need this if you want app persistence serde_json = "1.0.89" nostr = { version = "0.30.0" } -nostrdb = { git = "https://github.com/damus-io/nostrdb-rs", rev = "6d22af6d5159be4c9e4579f8c9d3af836e0d470a" } +nostrdb = { git = "https://github.com/damus-io/nostrdb-rs", rev = "9bbafd8a2e904b77a51e7cfca71eb5bb5650e829" } hex = "0.4.3" tracing = "0.1.40" env_logger = "0.11.1" diff --git a/queries/reposts.json b/queries/reposts.json index d455956..2e5f255 100644 --- a/queries/reposts.json +++ b/queries/reposts.json @@ -1,7 +1 @@ -{ - "limit": 100, - "kinds": [ - 1, 6 - ], - "#p": ["32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"] -} +{ "limit": 100, "kinds": [ 6 ] } diff --git a/src/app_style.rs b/src/app_style.rs index 9cf9bc2..71a0b7d 100644 --- a/src/app_style.rs +++ b/src/app_style.rs @@ -96,7 +96,7 @@ pub fn mobile_font_size(text_style: &NotedeckTextStyle) -> f32 { } } -#[derive(EnumIter)] +#[derive(Copy, Clone, Eq, PartialEq, Debug, EnumIter)] pub enum NotedeckTextStyle { Heading, Heading2, diff --git a/src/ui/note/mod.rs b/src/ui/note/mod.rs index cf4cc69..a9c5b33 100644 --- a/src/ui/note/mod.rs +++ b/src/ui/note/mod.rs @@ -327,19 +327,21 @@ impl<'a> NoteView<'a> { action: None, } } else { - let txn = self.note.txn().expect("todo: support non-db notes"); + let txn = self.note.txn().expect("txn"); if let Some(note_to_repost) = get_reposted_note(self.ndb, txn, self.note) { let profile = self.ndb.get_profile_by_pubkey(txn, self.note.pubkey()); + let style = NotedeckTextStyle::Small; ui.horizontal(|ui| { ui.vertical(|ui| { ui.add_space(2.0); ui.add_sized([20.0, 20.0], repost_icon()); }); ui.add_space(6.0); - let resp = ui.add(one_line_display_name_widget(get_display_name( - profile.as_ref().ok(), - ))); + let resp = ui.add(one_line_display_name_widget( + get_display_name(profile.as_ref().ok()), + style, + )); if let Ok(rec) = &profile { resp.on_hover_ui_at_pointer(|ui| { ui.set_max_width(300.0); @@ -349,7 +351,8 @@ impl<'a> NoteView<'a> { ui.add_space(4.0); ui.label( RichText::new("Reposted") - .text_style(NotedeckTextStyle::Heading3.text_style()), + .color(colors::GRAY_SECONDARY) + .text_style(style.text_style()), ); }); NoteView::new(self.ndb, self.note_cache, self.img_cache, ¬e_to_repost).show(ui) diff --git a/src/ui/profile/preview.rs b/src/ui/profile/preview.rs index 42ea7b2..860177a 100644 --- a/src/ui/profile/preview.rs +++ b/src/ui/profile/preview.rs @@ -198,17 +198,25 @@ fn display_name_widget( } } -pub fn one_line_display_name_widget(display_name: DisplayName<'_>) -> impl egui::Widget + '_ { +pub fn one_line_display_name_widget( + display_name: DisplayName<'_>, + style: NotedeckTextStyle, +) -> impl egui::Widget + '_ { + let text_style = style.text_style(); move |ui: &mut egui::Ui| match display_name { - DisplayName::One(n) => { - ui.label(RichText::new(n).text_style(NotedeckTextStyle::Heading3.text_style())) - } + DisplayName::One(n) => ui.label( + RichText::new(n) + .text_style(text_style) + .color(colors::GRAY_SECONDARY), + ), DisplayName::Both { display_name, username: _, } => ui.label( - RichText::new(display_name).text_style(NotedeckTextStyle::Heading3.text_style()), + RichText::new(display_name) + .text_style(text_style) + .color(colors::GRAY_SECONDARY), ), } }