damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 5c87dd5bbb9c23dc94baf6e0cbfe87f2db52938d
parent 12febf96712acf2093276441a1fdcaa293ae1ea9
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 17 Jul 2023 11:24:33 -0700

nip05: remove clickable option

they're always clickable now

Diffstat:
Mdamus/Components/NIP05Badge.swift | 31+++++++++++--------------------
Mdamus/Views/Profile/ProfileName.swift | 2+-
2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/damus/Components/NIP05Badge.swift b/damus/Components/NIP05Badge.swift @@ -12,16 +12,14 @@ struct NIP05Badge: View { let pubkey: String let contacts: Contacts let show_domain: Bool - let clickable: Bool @Environment(\.openURL) var openURL - init(nip05: NIP05, pubkey: String, contacts: Contacts, show_domain: Bool, clickable: Bool) { + init(nip05: NIP05, pubkey: String, contacts: Contacts, show_domain: Bool) { self.nip05 = nip05 self.pubkey = pubkey self.contacts = contacts self.show_domain = show_domain - self.clickable = clickable } var nip05_color: Bool { @@ -54,23 +52,16 @@ struct NIP05Badge: View { var body: some View { HStack(spacing: 2) { - - Seal if show_domain { - if clickable { - Text(nip05_string) - .nip05_colorized(gradient: nip05_color) - .onTapGesture { - if let nip5url = nip05.siteUrl { - openURL(nip5url) - } + Text(nip05_string) + .nip05_colorized(gradient: nip05_color) + .onTapGesture { + if let nip5url = nip05.siteUrl { + openURL(nip5url) } - } else { - Text(nip05_string) - .foregroundColor(.gray) - } + } } } @@ -96,13 +87,13 @@ struct NIP05Badge_Previews: PreviewProvider { static var previews: some View { let test_state = test_damus_state() VStack { - NIP05Badge(nip05: NIP05(username: "jb55", host: "jb55.com"), pubkey: test_state.pubkey, contacts: test_state.contacts, show_domain: true, clickable: true) + NIP05Badge(nip05: NIP05(username: "jb55", host: "jb55.com"), pubkey: test_state.pubkey, contacts: test_state.contacts, show_domain: true) - NIP05Badge(nip05: NIP05(username: "_", host: "jb55.com"), pubkey: test_state.pubkey, contacts: test_state.contacts, show_domain: true, clickable: true) + NIP05Badge(nip05: NIP05(username: "_", host: "jb55.com"), pubkey: test_state.pubkey, contacts: test_state.contacts, show_domain: true) - NIP05Badge(nip05: NIP05(username: "jb55", host: "jb55.com"), pubkey: test_state.pubkey, contacts: test_state.contacts, show_domain: true, clickable: false) + NIP05Badge(nip05: NIP05(username: "jb55", host: "jb55.com"), pubkey: test_state.pubkey, contacts: test_state.contacts, show_domain: true) - NIP05Badge(nip05: NIP05(username: "jb55", host: "jb55.com"), pubkey: test_state.pubkey, contacts: Contacts(our_pubkey: "sdkfjsdf"), show_domain: true, clickable: false) + NIP05Badge(nip05: NIP05(username: "jb55", host: "jb55.com"), pubkey: test_state.pubkey, contacts: Contacts(our_pubkey: "sdkfjsdf"), show_domain: true) } } } diff --git a/damus/Views/Profile/ProfileName.swift b/damus/Views/Profile/ProfileName.swift @@ -85,7 +85,7 @@ struct ProfileName: View { .font(.body) .fontWeight(prefix == "@" ? .none : .bold) if let nip05 = current_nip05 { - NIP05Badge(nip05: nip05, pubkey: pubkey, contacts: damus_state.contacts, show_domain: show_nip5_domain, clickable: true) + NIP05Badge(nip05: nip05, pubkey: pubkey, contacts: damus_state.contacts, show_domain: show_nip5_domain) } if let friend = friend_type, current_nip05 == nil { FriendIcon(friend: friend)