diff --git a/src/shared/components/instances.tsx b/src/shared/components/instances.tsx index 40dcf75..36c3afd 100644 --- a/src/shared/components/instances.tsx +++ b/src/shared/components/instances.tsx @@ -4,6 +4,8 @@ import { i18n } from "../i18next"; import { instance_stats } from "../instance_stats"; import { numToSI } from "../utils"; +const min_monthly_users = 5; + export class Instances extends Component { constructor(props: any, context: any) { super(props, context); @@ -86,51 +88,61 @@ export class Instances extends Component {

{header}

- {instances.map(instance => { - let domain = instance.domain; - let users_active_month = - instance.site_info.site_view.counts.users_active_month; - let description = instance.site_info.site_view.site.description; - let icon = instance.site_info.site_view.site.icon; - let require_application = - instance.site_info.site_view.site.require_application; - return ( -
-
-
-

{domain}

-

- - {i18n.t("users_active_per_month", { - count: users_active_month, - formattedCount: numToSI(users_active_month), - })} - -

+ {instances + .filter( + i => + i.site_info.site_view.local_site.registration_mode != "closed" + ) + .filter( + i => + i.site_info.site_view.counts.users_active_month > + min_monthly_users + ) + .map(instance => { + let domain = instance.domain; + let users_active_month = + instance.site_info.site_view.counts.users_active_month; + let description = instance.site_info.site_view.site.description; + let icon = instance.site_info.site_view.site.icon; + let require_application = + instance.site_info.site_view.site.require_application; + return ( +
+
+
+

{domain}

+

+ + {i18n.t("users_active_per_month", { + count: users_active_month, + formattedCount: numToSI(users_active_month), + })} + +

+
+
+
+
-
-
- +
+

{description}

+
-
-

{description}

- -
- ); - })} + ); + })}
);