Skip to content

Commit

Permalink
feat(user): show current user account age in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoAlgorithm committed Sep 28, 2023
1 parent c2c38f6 commit 4f46c31
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion Swiftcord/Views/User/Avatar/UserAvatarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ struct UserAvatarView: View {
Text("Member Since")
.font(.headline)
.textCase(.uppercase)
.padding(.top, 6)
HStack(spacing: 8) {
Image("DiscordIcon").resizable().aspectRatio(contentMode: .fit).frame(width: 16)
Text(user.id.createdAt?.formatted(.dateTime.day().month().year()) ?? "Unknown")
Expand Down
12 changes: 10 additions & 2 deletions Swiftcord/Views/User/CurrentUserFooter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,16 @@ struct CurrentUserFooter: View {
.buttonStyle(.plain)
.popover(isPresented: $userPopoverPresented) {
MiniUserProfileView(user: User(from: user), member: nil) {
VStack(spacing: 4) {
if !(user.bio?.isEmpty ?? true) { Divider() }
VStack(alignment: .leading, spacing: 4) {
VStack(alignment: .leading, spacing: 6) {
Text("Discord Member Since")
.font(.headline)
.textCase(.uppercase)
Text(user.id.createdAt?.formatted(.dateTime.day().month().year()) ?? "Unknown")
}
.padding(.bottom, 8)

Divider()

// Set presence
Menu {
Expand Down
1 change: 1 addition & 0 deletions Swiftcord/Views/User/Profile/MiniUserProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ struct MiniUserProfileView<RichContentSlot: View>: View {
Text("user.bio").font(.headline).textCase(.uppercase)
Text(markdown: bio)
.fixedSize(horizontal: false, vertical: true)
.padding(.bottom, 6)
}

contentSlot
Expand Down

0 comments on commit 4f46c31

Please sign in to comment.