commit 6ca6a76fdbe1b1226d8dec5bed3a354ea4367cf0
parent 504b21e91c54603c249be4bbef688b0fd2917060
Author: kernelkind <kernelkind@gmail.com>
Date: Wed, 31 Jan 2024 14:23:54 -0500
repost: hide member signup date
The purple membership badge should be displayed as compact view
everywhere except the user's profile.
Lightning-address: kernelkind@getalby.com
Changelog-Fixed: Hide member signup date on reposts
Signed-off-by: kernelkind <kernelkind@gmail.com>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/damus/Views/Profile/ProfileName.swift b/damus/Views/Profile/ProfileName.swift
@@ -37,17 +37,19 @@ struct ProfileName: View {
let prefix: String
let show_nip5_domain: Bool
+ private let supporterBadgeStyle: SupporterBadge.Style
@State var display_name: DisplayName?
@State var nip05: NIP05?
@State var donation: Int?
@State var purple_account: DamusPurple.Account?
- init(pubkey: Pubkey, prefix: String = "", damus: DamusState, show_nip5_domain: Bool = true) {
+ init(pubkey: Pubkey, prefix: String = "", damus: DamusState, show_nip5_domain: Bool = true, supporterBadgeStyle: SupporterBadge.Style = .compact) {
self.pubkey = pubkey
self.prefix = prefix
self.damus_state = damus
self.show_nip5_domain = show_nip5_domain
+ self.supporterBadgeStyle = supporterBadgeStyle
self.purple_account = nil
}
@@ -109,7 +111,7 @@ struct ProfileName: View {
.frame(width: 14, height: 14)
}
- SupporterBadge(percent: supporter(profile: profile), purple_account: self.purple_account, style: .full)
+ SupporterBadge(percent: supporter(profile: profile), purple_account: self.purple_account, style: supporterBadgeStyle)
}
diff --git a/damus/Views/Profile/ProfileNameView.swift b/damus/Views/Profile/ProfileNameView.swift
@@ -22,7 +22,7 @@ struct ProfileNameView: View {
switch Profile.displayName(profile: profile, pubkey: pubkey) {
case .one:
HStack(alignment: .center, spacing: spacing) {
- ProfileName(pubkey: pubkey, damus: damus)
+ ProfileName(pubkey: pubkey, damus: damus, supporterBadgeStyle: .full)
.font(.title3.weight(.bold))
}
case .both(username: _, displayName: let displayName):
@@ -30,7 +30,7 @@ struct ProfileNameView: View {
.font(.title3.weight(.bold))
HStack(alignment: .center, spacing: spacing) {
- ProfileName(pubkey: pubkey, prefix: "@", damus: damus)
+ ProfileName(pubkey: pubkey, prefix: "@", damus: damus, supporterBadgeStyle: .full)
.font(.callout)
.foregroundColor(.gray)
}