From fb8c470e9d26099228e5fdaf439b7289ed2132a0 Mon Sep 17 00:00:00 2001 From: Grimless Date: Mon, 4 Sep 2023 00:54:13 -0400 Subject: [PATCH] Separate NIP-05 and username/display name onto their own lines. Closes: https://github.com/damus-io/damus/pull/1534 Reviewed-by: William Casarin Signed-off-by: William Casarin --- damus/Views/Profile/ProfileName.swift | 30 ++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/damus/Views/Profile/ProfileName.swift b/damus/Views/Profile/ProfileName.swift index 2a6acfd4..a461987f 100644 --- a/damus/Views/Profile/ProfileName.swift +++ b/damus/Views/Profile/ProfileName.swift @@ -80,23 +80,25 @@ struct ProfileName: View { } var body: some View { - HStack(spacing: 2) { - Text(verbatim: "\(prefix)\(name_choice)") - .font(.body) - .fontWeight(prefix == "@" ? .none : .bold) + VStack(alignment: .leading, spacing: 2) { + HStack(spacing: 2) { + Text(verbatim: "\(prefix)\(name_choice)") + .font(.body) + .fontWeight(prefix == "@" ? .none : .bold) + if let friend = friend_type, current_nip05 == nil { + FriendIcon(friend: friend) + } + if onlyzapper { + Image("zap-hashtag") + .frame(width: 14, height: 14) + } + if let supporter { + SupporterBadge(percent: supporter) + } + } if let nip05 = current_nip05 { NIP05Badge(nip05: nip05, pubkey: pubkey, contacts: damus_state.contacts, show_domain: show_nip5_domain, profiles: damus_state.profiles) } - if let friend = friend_type, current_nip05 == nil { - FriendIcon(friend: friend) - } - if onlyzapper { - Image("zap-hashtag") - .frame(width: 14, height: 14) - } - if let supporter { - SupporterBadge(percent: supporter) - } } .onReceive(handle_notify(.profile_updated)) { update in if update.pubkey != pubkey {