Skip to content

Commit

Permalink
Update CommunityStatsView.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf committed Jan 4, 2024
1 parent b234fc7 commit 338a3dd
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions Mlem/Views/Tabs/Feeds/CommunityStatsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,20 @@ struct CommunityStatsView: View {
.frame(maxWidth: .infinity)

if let activeUserCount = community.activeUserCount {
Text("Active Users")
.foregroundStyle(.secondary)
HStack(spacing: 16) {
activeUserBox("6mo", value: activeUserCount.sixMonths)
activeUserBox("1mo", value: activeUserCount.month)
activeUserBox("1w", value: activeUserCount.week)
activeUserBox("1d", value: activeUserCount.day)
VStack(spacing: 5) {
Text("Active Users")
.foregroundStyle(.secondary)
HStack(spacing: 16) {
activeUserBox("6mo", value: activeUserCount.sixMonths)
activeUserBox("1mo", value: activeUserCount.month)
activeUserBox("1w", value: activeUserCount.week)
activeUserBox("1d", value: activeUserCount.day)
}
}
.padding(.vertical, 10)
.frame(maxWidth: .infinity)
.background(Color(uiColor: .secondarySystemGroupedBackground))
.cornerRadius(AppConstants.largeItemCornerRadius)
}
}
.padding(.horizontal, 16)
Expand All @@ -79,16 +85,14 @@ struct CommunityStatsView: View {
@ViewBuilder
func activeUserBox(_ label: String, value: Int) -> some View {
VStack {
Text(label)
.foregroundStyle(.secondary)
Text(abbreviateNumber(value))
.font(.title3)
.fontWeight(.semibold)
Text(label)
.foregroundStyle(.secondary)
}
.padding(.vertical, 10)
.frame(maxWidth: .infinity)
.background(Color(uiColor: .secondarySystemGroupedBackground))
.cornerRadius(AppConstants.largeItemCornerRadius)

}
}

Expand Down

0 comments on commit 338a3dd

Please sign in to comment.