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 prefix: String
|
||||||
|
|
||||||
let show_nip5_domain: Bool
|
let show_nip5_domain: Bool
|
||||||
|
private let supporterBadgeStyle: SupporterBadge.Style
|
||||||
|
|
||||||
@State var display_name: DisplayName?
|
@State var display_name: DisplayName?
|
||||||
@State var nip05: NIP05?
|
@State var nip05: NIP05?
|
||||||
@State var donation: Int?
|
@State var donation: Int?
|
||||||
@State var purple_account: DamusPurple.Account?
|
@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.pubkey = pubkey
|
||||||
self.prefix = prefix
|
self.prefix = prefix
|
||||||
self.damus_state = damus
|
self.damus_state = damus
|
||||||
self.show_nip5_domain = show_nip5_domain
|
self.show_nip5_domain = show_nip5_domain
|
||||||
|
self.supporterBadgeStyle = supporterBadgeStyle
|
||||||
self.purple_account = nil
|
self.purple_account = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +111,7 @@ struct ProfileName: View {
|
|||||||
.frame(width: 14, height: 14)
|
.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) {
|
switch Profile.displayName(profile: profile, pubkey: pubkey) {
|
||||||
case .one:
|
case .one:
|
||||||
HStack(alignment: .center, spacing: spacing) {
|
HStack(alignment: .center, spacing: spacing) {
|
||||||
ProfileName(pubkey: pubkey, damus: damus)
|
ProfileName(pubkey: pubkey, damus: damus, supporterBadgeStyle: .full)
|
||||||
.font(.title3.weight(.bold))
|
.font(.title3.weight(.bold))
|
||||||
}
|
}
|
||||||
case .both(username: _, displayName: let displayName):
|
case .both(username: _, displayName: let displayName):
|
||||||
@@ -30,7 +30,7 @@ struct ProfileNameView: View {
|
|||||||
.font(.title3.weight(.bold))
|
.font(.title3.weight(.bold))
|
||||||
|
|
||||||
HStack(alignment: .center, spacing: spacing) {
|
HStack(alignment: .center, spacing: spacing) {
|
||||||
ProfileName(pubkey: pubkey, prefix: "@", damus: damus)
|
ProfileName(pubkey: pubkey, prefix: "@", damus: damus, supporterBadgeStyle: .full)
|
||||||
.font(.callout)
|
.font(.callout)
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user