-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Community stats #750
Community stats #750
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving comments before merging so you can see @bohn002
<Text fontSize="xl" fontWeight="bold"> | ||
Stats: | ||
</Text> | ||
<HStack flexWrap="wrap"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<HStack flexWrap="wrap"> | |
<HStack flexWrap="wrap" space={1}> |
const subscribers = shortenNumber(counts.subscribers); | ||
const posts = shortenNumber(counts.posts); | ||
const comments = shortenNumber(counts.comments); | ||
const usersActiveMonth = shortenNumber(counts.users_active_month); | ||
const usersActiveWeek = shortenNumber(counts.users_active_week); | ||
const usersActiveDay = shortenNumber(counts.users_active_day); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bohn002 we already had this util (but I realized it was broken, so fixed it). Also you named the function (PrettyNumbers) with PascalCase, but non React component functions should be camelCase.
React components - PascalCase
Everything else - camelCase
import AvatarUsername from "./AvatarUsername"; | ||
|
||
interface IProps { | ||
item: any; | ||
moderators: CommunityModeratorView[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to just pass the moderators list instead of being for 1 item in the list. Also don't use any
if you can. It makes it so typescript just doesn't work, which is not actually helpful generally.
PR Creator Checklist
Ensure you've checked the following before submitting your PR:
Summary
Resolves #670 Adds stats to the Community About page. When a stat gets above or equals 1000, a prettier version of the digit is displayed. So 1,234 is displayed as 1.2k etc.
Screenshots
Test Plan
Open the feed, select a Community. Click "About". Scroll page down to "Stats".