commit bbfe5380e0f3addaaa1c5bd5db1928bc8a80dea2
parent 8a20b7e4a781d7db680f55bf8583559d3adc0470
Author: William Casarin <jb55@jb55.com>
Date: Thu, 20 Apr 2023 14:40:39 -0700
Add onlyzap badges to usernames
Diffstat:
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/damus/Views/Profile/EventProfileName.swift b/damus/Views/Profile/EventProfileName.swift
@@ -50,7 +50,15 @@ struct EventProfileName: View {
var current_display_name: DisplayName {
return display_name ?? Profile.displayName(profile: profile, pubkey: pubkey)
}
-
+
+ var onlyzapper: Bool {
+ guard let profile else {
+ return false
+ }
+
+ return profile.reactions == false
+ }
+
var body: some View {
HStack(spacing: 2) {
switch current_display_name {
@@ -74,6 +82,11 @@ struct EventProfileName: View {
if current_nip05 == nil, let frend = friend_type {
FriendIcon(friend: frend)
}
+
+ if onlyzapper {
+ Image("zap-hashtag")
+ .frame(width: 14, height: 14)
+ }
}
.onReceive(handle_notify(.profile_updated)) { notif in
let update = notif.object as! ProfileUpdate
diff --git a/damus/Views/Profile/ProfileName.swift b/damus/Views/Profile/ProfileName.swift
@@ -70,6 +70,14 @@ struct ProfileName: View {
return prefix == "@" ? current_display_name.username : current_display_name.display_name
}
+ var onlyzapper: Bool {
+ guard let profile else {
+ return false
+ }
+
+ return profile.reactions == false
+ }
+
var body: some View {
HStack(spacing: 2) {
Text(verbatim: "\(prefix)\(name_choice)")
@@ -81,6 +89,10 @@ struct ProfileName: View {
if let friend = friend_type, current_nip05 == nil {
FriendIcon(friend: friend)
}
+ if onlyzapper {
+ Image("zap-hashtag")
+ .frame(width: 14, height: 14)
+ }
}
.onReceive(handle_notify(.profile_updated)) { notif in
let update = notif.object as! ProfileUpdate