Add onlyzap badges to usernames
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user