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.post.pinned" = "Angehefteter Post";
"account.posts" = "Posts"; "account.posts" = "Posts";
"account.relation.follows-you" = "Folgt dir"; "account.relation.follows-you" = "Folgt dir";
"account.joined" = "Beigetreten";
// MARK: Package: Conversations // MARK: Package: Conversations
"conversations.action.delete" = "Löschen"; "conversations.action.delete" = "Löschen";

View file

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

View file

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

View file

@ -41,6 +41,8 @@ public struct AccountDetailView: View {
} content: { } content: {
LazyVStack(alignment: .leading) { LazyVStack(alignment: .leading) {
makeHeaderView(proxy: proxy) makeHeaderView(proxy: proxy)
joinedAtView
.offset(y: -36)
familiarFollowers familiarFollowers
.offset(y: -36) .offset(y: -36)
featuredTagsView featuredTagsView
@ -146,6 +148,22 @@ public struct AccountDetailView: View {
} }
} }
@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 @ViewBuilder
private var featuredTagsView: some View { private var featuredTagsView: some View {
if !viewModel.featuredTags.isEmpty || !viewModel.fields.isEmpty { if !viewModel.featuredTags.isEmpty || !viewModel.fields.isEmpty {