refactor: rename ui::Note to ui::NoteView

Easier to jump to when using tags.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-07-10 09:52:33 -07:00
parent f795fe6088
commit 61bc9d9919
6 changed files with 16 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ use crate::{colors, notecache::CachedNote, ui, ui::View, Damus};
use egui::{Label, RichText, Sense};
use nostrdb::{NoteKey, Transaction};
pub struct Note<'a> {
pub struct NoteView<'a> {
app: &'a mut Damus,
note: &'a nostrdb::Note<'a>,
flags: NoteOptions,
@@ -23,7 +23,7 @@ pub struct NoteResponse {
pub action: Option<BarAction>,
}
impl<'a> View for Note<'a> {
impl<'a> View for NoteView<'a> {
fn ui(&mut self, ui: &mut egui::Ui) {
self.show(ui);
}
@@ -114,10 +114,10 @@ fn reply_desc(
}
}
impl<'a> Note<'a> {
impl<'a> NoteView<'a> {
pub fn new(app: &'a mut Damus, note: &'a nostrdb::Note<'a>) -> Self {
let flags = NoteOptions::actionbar | NoteOptions::note_previews;
Note { app, note, flags }
Self { app, note, flags }
}
pub fn actionbar(mut self, enable: bool) -> Self {
@@ -225,7 +225,7 @@ impl<'a> Note<'a> {
ui,
egui::Id::new((profile_key, note_key)),
pfp_size,
ui::Note::expand_size(),
ui::NoteView::expand_size(),
anim_speed,
);