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>
This commit is contained in:
committed by
William Casarin
parent
504b21e91c
commit
6ca6a76fdb
@@ -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)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user