From 7f0fd45f3a1411294e6f43e3bd47c3fa05f4e6c7 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sat, 20 Jul 2024 18:20:10 +0100 Subject: [PATCH] singular & plural count --- .../client/src/features/page/components/page-import-modal.tsx | 4 +++- apps/client/src/features/space/components/space-list.tsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/client/src/features/page/components/page-import-modal.tsx b/apps/client/src/features/page/components/page-import-modal.tsx index 8ac6eda7..baa9536e 100644 --- a/apps/client/src/features/page/components/page-import-modal.tsx +++ b/apps/client/src/features/page/components/page-import-modal.tsx @@ -92,10 +92,12 @@ function ImportFormatSelection({ spaceId, onClose }: ImportFormatSelection) { } if (pageCount > 0) { + const pageCountText = pageCount === 1 ? "1 page" : `${pageCount} pages`; + notifications.update({ id: alert, color: "teal", - title: `Successfully imported ${pageCount} pages`, + title: `Successfully imported ${pageCountText}`, message: "Your import is complete.", icon: , loading: false, diff --git a/apps/client/src/features/space/components/space-list.tsx b/apps/client/src/features/space/components/space-list.tsx index af3f8ad9..48253fdc 100644 --- a/apps/client/src/features/space/components/space-list.tsx +++ b/apps/client/src/features/space/components/space-list.tsx @@ -3,6 +3,7 @@ import React, { useState } from "react"; import { useGetSpacesQuery } from "@/features/space/queries/space-query.ts"; import SpaceSettingsModal from "@/features/space/components/settings-modal.tsx"; import { useDisclosure } from "@mantine/hooks"; +import { formatMemberCount } from "@/lib"; export default function SpaceList() { const { data, isLoading } = useGetSpacesQuery(); @@ -50,7 +51,7 @@ export default function SpaceList() { - {space.memberCount} members + {formatMemberCount(space.memberCount)} ))}