Add joined date info on user profile close #158

This commit is contained in:
Thomas Ricouard 2023-01-20 18:25:27 +01:00
parent a8711e6adc
commit 7a0b635033
4 changed files with 21 additions and 0 deletions

View file

@ -157,6 +157,7 @@
"account.post.pinned" = "Angehefteter Post";
"account.posts" = "Posts";
"account.relation.follows-you" = "Folgt dir";
"account.joined" = "Beigetreten";
// MARK: Package: Conversations
"conversations.action.delete" = "Löschen";

View file

@ -157,6 +157,7 @@
"account.post.pinned" = "Pinned post";
"account.posts" = "Posts";
"account.relation.follows-you" = "Follows You";
"account.joined" = "Joined";
// MARK: Package: Conversations
"conversations.action.delete" = "Delete";

View file

@ -157,6 +157,7 @@
"account.post.pinned" = "Vastgezette post";
"account.posts" = "Posts";
"account.relation.follows-you" = "Volgt Jou";
"account.joined" = "Lid geworden";
// MARK: Package: Conversations
"conversations.action.delete" = "Verwijderen";

View file

@ -41,6 +41,8 @@ public struct AccountDetailView: View {
} content: {
LazyVStack(alignment: .leading) {
makeHeaderView(proxy: proxy)
joinedAtView
.offset(y: -36)
familiarFollowers
.offset(y: -36)
featuredTagsView
@ -145,6 +147,22 @@ public struct AccountDetailView: View {
Text("Error: \(error.localizedDescription)")
}
}
@ViewBuilder
private var joinedAtView: some View {
if let joinedAt = viewModel.account?.createdAt.asDate {
HStack(spacing: 4) {
Image(systemName: "calendar")
Text("account.joined")
Text(joinedAt, style: .date)
}
.foregroundColor(.gray)
.font(.footnote)
.padding(.horizontal, .layoutPadding)
.padding(.top, 2)
.padding(.bottom, 5)
}
}
@ViewBuilder
private var featuredTagsView: some View {