mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-23 03:04:19 +01:00
hashtags: click hashtags to open them
Fixes: https://github.com/damus-io/notedeck/issues/695 Fixes: https://github.com/damus-io/notedeck/issues/713 Changelog-Added: Add ability to click hashtags Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
use crate::actionbar::NoteAction;
|
||||
use crate::images::ImageType;
|
||||
use crate::ui::{
|
||||
self,
|
||||
note::{NoteOptions, NoteResponse},
|
||||
ProfilePic,
|
||||
};
|
||||
use crate::{actionbar::NoteAction, images::ImageType, timeline::TimelineKind};
|
||||
use egui::{Color32, Hyperlink, Image, RichText};
|
||||
use nostrdb::{BlockType, Mention, Ndb, Note, NoteKey, Transaction};
|
||||
use tracing::warn;
|
||||
@@ -198,7 +197,15 @@ fn render_note_contents(
|
||||
BlockType::Hashtag => {
|
||||
#[cfg(feature = "profiling")]
|
||||
puffin::profile_scope!("hashtag contents");
|
||||
ui.colored_label(link_color, format!("#{}", block.as_str()));
|
||||
let resp = ui.colored_label(link_color, format!("#{}", block.as_str()));
|
||||
|
||||
if resp.clicked() {
|
||||
note_action = Some(NoteAction::OpenTimeline(TimelineKind::Hashtag(
|
||||
block.as_str().to_string(),
|
||||
)));
|
||||
} else if resp.hovered() {
|
||||
ui::show_pointer(ui);
|
||||
}
|
||||
}
|
||||
|
||||
BlockType::Url => {
|
||||
|
||||
Reference in New Issue
Block a user