-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed long name truncation in profile (#334)
- Loading branch information
1 parent
9575fbf
commit 2da6076
Showing
1 changed file
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ struct CommunitySidebarHeader : View { | |
CommunitySidebarHeaderAvatar(imageUrl: avatarUrl) | ||
|
||
HStack { | ||
Text(avatarSubtext) | ||
Text(avatarSubtext).minimumScaleFactor(0.01) | ||
}.foregroundColor(.gray) | ||
|
||
}.padding([.leading]) | ||
|
@@ -59,8 +59,15 @@ struct CommunitySidebarHeader : View { | |
}.frame(width: .infinity, height: 16) | ||
Spacer().frame(height: 20) | ||
|
||
Text(title).font(.title).bold().lineLimit(1) | ||
Text(subtitle).font(.footnote).lineLimit(1) | ||
Text(title) | ||
.font(.title) | ||
.bold() | ||
.lineLimit(1) | ||
.minimumScaleFactor(0.01) | ||
Text(subtitle) | ||
.font(.footnote) | ||
.lineLimit(1) | ||
.minimumScaleFactor(0.01) | ||
|
||
}.padding([.trailing]) | ||
} | ||
|
@@ -72,10 +79,14 @@ struct CommunitySidebarHeader : View { | |
struct SidebarHeaderPreview: PreviewProvider { | ||
static var previews: some View { | ||
VStack { | ||
CommunitySidebarHeader(title: "TestCommunity", subtitle: "@testcommunity@foo.bar", | ||
CommunitySidebarHeader(title: "TestCommunityWithLongName", subtitle: "@testcommunity@longnamedomain.website", | ||
avatarSubtext: "Created 3 days ago", | ||
bannerURL: URL(string: "https://vlemmy.net/pictrs/image/719b61b3-8d8e-4aec-9f15-17be4a081f97.jpeg?format=webp"), | ||
avatarUrl: URL(string: "https://vlemmy.net/pictrs/image/190f2d6a-ac38-448d-ae9b-f6d751eb6e69.png?format=webp"), label1: "Label 1", label2: "Label 2").border(.red) | ||
avatarUrl: URL(string: "https://vlemmy.net/pictrs/image/190f2d6a-ac38-448d-ae9b-f6d751eb6e69.png?format=webp"), label1: "Label 1", label2: "Label 2") | ||
CommunitySidebarHeader(title: "Test", subtitle: "@[email protected]", | ||
avatarSubtext: "Created 3 days ago", | ||
bannerURL: URL(string: "https://vlemmy.net/pictrs/image/719b61b3-8d8e-4aec-9f15-17be4a081f97.jpeg?format=webp"), | ||
avatarUrl: URL(string: "https://vlemmy.net/pictrs/image/190f2d6a-ac38-448d-ae9b-f6d751eb6e69.png?format=webp"), label1: "Label 1", label2: "Label 2") | ||
Spacer() | ||
} | ||
} | ||
|