From 254b764a3d4d80b38bb920ed42d1e955d8276e63 Mon Sep 17 00:00:00 2001 From: Oliver Dudgeon <22367286+OliverDudgeon@users.noreply.github.com> Date: Wed, 1 May 2024 21:30:40 +0100 Subject: [PATCH] fix: fix texts in some file actions --- components/projects/CreateProject/CreateProjectForm.tsx | 2 +- components/projects/CreateProject/CreateProjectListItem.tsx | 2 +- .../contextActions/CreateDefaultUnitListItem.tsx | 2 +- .../ContextSection/contextActions/EditUnitListItem.tsx | 2 +- utils/app/language.ts | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/projects/CreateProject/CreateProjectForm.tsx b/components/projects/CreateProject/CreateProjectForm.tsx index 23bac02ff..b41a24f1e 100644 --- a/components/projects/CreateProject/CreateProjectForm.tsx +++ b/components/projects/CreateProject/CreateProjectForm.tsx @@ -176,7 +176,7 @@ export const CreateProjectForm = ({ }} > - Unit default privacy: {defaultPrivacy.split("_").join(" ").toLowerCase()} + Unit default privacy: {defaultPrivacy.split("_").join(" ").toLocaleLowerCase()} { setOpen(true)}> diff --git a/features/userSettings/UserSettingsContent/ContextSection/contextActions/CreateDefaultUnitListItem.tsx b/features/userSettings/UserSettingsContent/ContextSection/contextActions/CreateDefaultUnitListItem.tsx index 6d189cf34..72b6abb1e 100644 --- a/features/userSettings/UserSettingsContent/ContextSection/contextActions/CreateDefaultUnitListItem.tsx +++ b/features/userSettings/UserSettingsContent/ContextSection/contextActions/CreateDefaultUnitListItem.tsx @@ -37,7 +37,7 @@ export const CreateDefaultUnitListItem = () => { void createDefaultUnitHandler()}> diff --git a/features/userSettings/UserSettingsContent/ContextSection/contextActions/EditUnitListItem.tsx b/features/userSettings/UserSettingsContent/ContextSection/contextActions/EditUnitListItem.tsx index ddfd8a213..c60130e79 100644 --- a/features/userSettings/UserSettingsContent/ContextSection/contextActions/EditUnitListItem.tsx +++ b/features/userSettings/UserSettingsContent/ContextSection/contextActions/EditUnitListItem.tsx @@ -19,7 +19,7 @@ export const EditUnitListItem = ({ unit }: EditUnitListItemProps) => { return ( <> setOpen((open) => !open)}> - + diff --git a/utils/app/language.ts b/utils/app/language.ts index 2bdd4071a..47f1be2cb 100644 --- a/utils/app/language.ts +++ b/utils/app/language.ts @@ -1 +1,4 @@ export const capitalise = (text: string) => text.replace(/\b\w/gu, (l) => l.toLocaleUpperCase()); + +export const shoutSnakeToLowerCase = (text: string) => + text.split("_").join(" ").toLocaleLowerCase();