diff --git a/app/src/main/java/com/jerboa/ui/components/common/AppBars.kt b/app/src/main/java/com/jerboa/ui/components/common/AppBars.kt index 9895ca55f..a817751cc 100644 --- a/app/src/main/java/com/jerboa/ui/components/common/AppBars.kt +++ b/app/src/main/java/com/jerboa/ui/components/common/AppBars.kt @@ -352,9 +352,12 @@ fun Sidebar( icon: String?, content: String?, published: String, - usersActiveMonth: Int, postCount: Int, - commentCount: Int + commentCount: Int, + usersActiveDay: Int, + usersActiveWeek: Int, + usersActiveMonth: Int, + usersActiveHalfYear: Int ) { val listState = rememberLazyListState() @@ -405,7 +408,10 @@ fun Sidebar( published = published ) CommentsAndPosts( + usersActiveDay = usersActiveDay, + usersActiveWeek = usersActiveWeek, usersActiveMonth = usersActiveMonth, + usersActiveHalfYear = usersActiveHalfYear, postCount = postCount, commentCount = commentCount ) @@ -425,16 +431,34 @@ fun Sidebar( @Composable fun CommentsAndPosts( + usersActiveDay: Int, + usersActiveWeek: Int, usersActiveMonth: Int, + usersActiveHalfYear: Int, postCount: Int, commentCount: Int ) { - Row { + FlowRow { + Text( + text = "${siFormat(usersActiveDay)} users / day", + color = MaterialTheme.colors.onBackground.muted + ) + DotSpacer() + Text( + text = "${siFormat(usersActiveWeek)} users / week", + color = MaterialTheme.colors.onBackground.muted + ) + DotSpacer() Text( text = "${siFormat(usersActiveMonth)} users / month", color = MaterialTheme.colors.onBackground.muted ) DotSpacer() + Text( + text = "${siFormat(usersActiveHalfYear)} users / 6 months", + color = MaterialTheme.colors.onBackground.muted + ) + DotSpacer() Text( text = "${siFormat(postCount)} posts", color = MaterialTheme.colors.onBackground.muted diff --git a/app/src/main/java/com/jerboa/ui/components/community/sidebar/CommunitySidebar.kt b/app/src/main/java/com/jerboa/ui/components/community/sidebar/CommunitySidebar.kt index 6107fb19b..f2e1766f7 100644 --- a/app/src/main/java/com/jerboa/ui/components/community/sidebar/CommunitySidebar.kt +++ b/app/src/main/java/com/jerboa/ui/components/community/sidebar/CommunitySidebar.kt @@ -14,7 +14,10 @@ fun CommunitySidebar(communityView: CommunityView) { banner = community.banner, icon = community.icon, published = community.published, + usersActiveDay = counts.users_active_day, + usersActiveWeek = counts.users_active_week, usersActiveMonth = counts.users_active_month, + usersActiveHalfYear = counts.users_active_half_year, postCount = counts.posts, commentCount = counts.comments ) diff --git a/app/src/main/java/com/jerboa/ui/components/home/sidebar/SiteSidebar.kt b/app/src/main/java/com/jerboa/ui/components/home/sidebar/SiteSidebar.kt index 86f2852ad..fc13447f5 100644 --- a/app/src/main/java/com/jerboa/ui/components/home/sidebar/SiteSidebar.kt +++ b/app/src/main/java/com/jerboa/ui/components/home/sidebar/SiteSidebar.kt @@ -12,11 +12,14 @@ fun SiteSidebar(siteView: SiteView) { val counts = siteView.counts Sidebar( title = site.description, - content = site.sidebar, banner = site.banner, icon = site.icon, + content = site.sidebar, published = site.published, + usersActiveDay = counts.users_active_day, + usersActiveWeek = counts.users_active_week, usersActiveMonth = counts.users_active_month, + usersActiveHalfYear = counts.users_active_half_year, postCount = counts.posts, commentCount = counts.comments )