Wrap long profile display name

Changelog-Fixed: Wrap long profile display names
Closes: #702
This commit is contained in:
OlegAba
2023-02-27 17:19:47 -05:00
committed by William Casarin
parent a9f62960ec
commit 3110abc65b

View File

@@ -134,11 +134,13 @@ struct EventProfileName: View {
if let real_name = profile?.display_name {
Text(real_name)
.font(.body.weight(.bold))
.padding([.trailing], 2)
Text(verbatim: "@\(display_name ?? Profile.displayName(profile: profile, pubkey: pubkey))")
+ Text(real_name.isEmpty ? "" : " ")
+ Text(verbatim: "@\(display_name ?? Profile.displayName(profile: profile, pubkey: pubkey))")
.foregroundColor(Color("DamusMediumGrey"))
.font(eventviewsize_to_font(size))
} else {
Text(verbatim: "\(display_name ?? Profile.displayName(profile: profile, pubkey: pubkey))")
.font(eventviewsize_to_font(size))