From cfa1d9ff0ace54f853127b79f68ba31f81da2b9e Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 1 Jul 2025 14:17:38 +0800 Subject: [PATCH] feat: add title-case package and use it for label formatting in GroupedList component Signed-off-by: Innei --- apps/mobile/package.json | 1 + apps/mobile/src/components/ui/grouped/GroupedList.tsx | 4 ++-- pnpm-lock.yaml | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 6433634a2..20b0d9626 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -125,6 +125,7 @@ "react-native-webview": "13.15.0", "shiki": "3.7.0", "tailwindcss": "3.4.17", + "title-case": "4.3.2", "use-sync-external-store": "1.5.0", "usehooks-ts": "3.1.1", "zeego": "3.0.6", diff --git a/apps/mobile/src/components/ui/grouped/GroupedList.tsx b/apps/mobile/src/components/ui/grouped/GroupedList.tsx index 8a0d3f3f0..cb222c36c 100644 --- a/apps/mobile/src/components/ui/grouped/GroupedList.tsx +++ b/apps/mobile/src/components/ui/grouped/GroupedList.tsx @@ -7,6 +7,7 @@ import type { PressableProps, ViewProps } from "react-native" import { Pressable, StyleSheet, Text, TouchableOpacity, View } from "react-native" import Animated, { FadeIn, FadeOut } from "react-native-reanimated" import type { SFSymbol } from "sf-symbols-typescript" +import { titleCase } from "title-case" import { CheckFilledIcon } from "@/src/icons/check_filled" import { MingcuteRightLine } from "@/src/icons/mingcute_right_line" @@ -189,7 +190,6 @@ export const GroupedInsetListNavigationLinkIcon: FC< ) } - export const GroupedInsetListCell: FC< { label: string @@ -208,7 +208,7 @@ export const GroupedInsetListCell: FC< {!!icon && } - {label} + {titleCase(label)} {!!description && ( {description} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62c7743ce..00e01d194 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1064,6 +1064,9 @@ importers: tailwindcss: specifier: 3.4.17 version: 3.4.17(ts-node@10.9.2(@types/node@24.0.3)(typescript@5.8.3)) + title-case: + specifier: 4.3.2 + version: 4.3.2 use-sync-external-store: specifier: 1.5.0 version: 1.5.0(react@19.0.0)