Make NIP-05 Domain Tappable

Closes: #275
Changelog-Added: Make purple badges on profile page tappable
This commit is contained in:
Joel Klabo
2023-01-06 16:08:25 -08:00
committed by William Casarin
parent b367382aae
commit 43cc3b6b6b
2 changed files with 11 additions and 0 deletions

View File

@@ -34,6 +34,8 @@ struct ProfileName: View {
@State var display_name: String?
@State var nip05: NIP05?
@Environment(\.openURL) var openURL
init(pubkey: String, profile: Profile?, damus: DamusState, show_friend_confirmed: Bool) {
self.pubkey = pubkey
self.profile = profile
@@ -72,6 +74,11 @@ struct ProfileName: View {
.foregroundColor(nip05_color)
Text(nip05.host)
.foregroundColor(nip05_color)
.onTapGesture {
if let nip5url = nip05.siteUrl {
openURL(nip5url)
}
}
}
if let friend = friend_icon, current_nip05 == nil {
Image(systemName: friend)