clickable boost links
Changelog-Added: Clicking boost text will go to that users profile Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -73,23 +73,30 @@ struct EventView: View {
|
|||||||
return Group {
|
return Group {
|
||||||
if event.known_kind == .boost, let inner_ev = event.inner_event {
|
if event.known_kind == .boost, let inner_ev = event.inner_event {
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
HStack {
|
let prof_model = ProfileModel(pubkey: event.pubkey, damus: damus)
|
||||||
Label("", systemImage: "arrow.2.squarepath")
|
let follow_model = FollowersModel(damus_state: damus, target: event.pubkey)
|
||||||
.foregroundColor(Color.gray)
|
let booster_profile = ProfileView(damus_state: damus, profile: prof_model, followers: follow_model)
|
||||||
ProfileName(pubkey: pubkey, profile: damus.profiles.lookup(id: pubkey))
|
|
||||||
.foregroundColor(Color.gray)
|
NavigationLink(destination: booster_profile) {
|
||||||
Text(" Boosted")
|
HStack {
|
||||||
.foregroundColor(Color.gray)
|
Label("", systemImage: "arrow.2.squarepath")
|
||||||
|
.foregroundColor(Color.gray)
|
||||||
|
ProfileName(pubkey: event.pubkey, profile: damus.profiles.lookup(id: event.pubkey))
|
||||||
|
.foregroundColor(Color.gray)
|
||||||
|
Text(" Boosted")
|
||||||
|
.foregroundColor(Color.gray)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TextEvent(inner_ev)
|
.buttonStyle(PlainButtonStyle())
|
||||||
|
TextEvent(inner_ev, pubkey: inner_ev.pubkey)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TextEvent(event)
|
TextEvent(event, pubkey: pubkey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TextEvent(_ event: NostrEvent) -> some View {
|
func TextEvent(_ event: NostrEvent, pubkey: String) -> some View {
|
||||||
let content = event.get_content(damus.keypair.privkey)
|
let content = event.get_content(damus.keypair.privkey)
|
||||||
return HStack(alignment: .top) {
|
return HStack(alignment: .top) {
|
||||||
let profile = damus.profiles.lookup(id: pubkey)
|
let profile = damus.profiles.lookup(id: pubkey)
|
||||||
|
|||||||
Reference in New Issue
Block a user