From 6ca6a76fdbe1b1226d8dec5bed3a354ea4367cf0 Mon Sep 17 00:00:00 2001 From: kernelkind Date: Wed, 31 Jan 2024 14:23:54 -0500 Subject: [PATCH] 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 Reviewed-by: William Casarin Signed-off-by: William Casarin --- damus/Views/Profile/ProfileName.swift | 6 ++++-- damus/Views/Profile/ProfileNameView.swift | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/damus/Views/Profile/ProfileName.swift b/damus/Views/Profile/ProfileName.swift index 0a2fa826..140ce09d 100644 --- 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 index f3feed2b..56153381 100644 --- 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) }