Add badge for local subscribers to communities (#2377)

* Add badge for local subscribers to communities

* Add local subscribers badge

---------

Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com>
This commit is contained in:
SleeplessOne1917 2024-02-27 13:59:18 +00:00 committed by GitHub
parent eb5095b686
commit 79ed590335
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 7 deletions

@ -1 +1 @@
Subproject commit 6c03b403c79bc5a893527d1fe217690db774a7ef
Subproject commit b4cb42fbdd63dece5de2abf7f33249e489166501

View file

@ -112,12 +112,20 @@ export const Badges = ({ counts, communityId }: BadgesProps) => {
</>
)}
{isCommunityAggregates(counts) && (
<li className="list-inline-item badge text-bg-secondary">
{I18NextService.i18n.t("number_of_subscribers", {
count: Number(counts.subscribers),
formattedCount: numToSI(counts.subscribers),
})}
</li>
<>
<li className="list-inline-item badge text-bg-secondary">
{I18NextService.i18n.t("number_of_local_subscribers", {
count: Number(counts.subscribers_local),
formattedCount: numToSI(counts.subscribers_local),
})}
</li>
<li className="list-inline-item badge text-bg-secondary">
{I18NextService.i18n.t("number_of_subscribers", {
count: Number(counts.subscribers),
formattedCount: numToSI(counts.subscribers),
})}
</li>
</>
)}
<li className="list-inline-item badge text-bg-secondary">
{I18NextService.i18n.t("number_of_posts", {

View file

@ -61,6 +61,7 @@ function getListingTypeFromQuery(listingType?: string): ListingType {
function getSortTypeFromQuery(type?: string): SortType {
return type ? (type as SortType) : "TopMonth";
}
function getCommunitiesQueryParams() {
return getQueryParams<CommunitiesProps>({
listingType: getListingTypeFromQuery,