From 53d24a6d24a5472c52c17cd565bafcf6aada5dd3 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 9 Jun 2023 11:42:38 +0200 Subject: [PATCH] Dont list instances with closed signups --- src/shared/components/instances.tsx | 91 +++++++++++++++-------------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/src/shared/components/instances.tsx b/src/shared/components/instances.tsx index 40dcf75..f50d5e3 100644 --- a/src/shared/components/instances.tsx +++ b/src/shared/components/instances.tsx @@ -86,51 +86,56 @@ 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" + ) + .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}

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