From b5a038fd501af60c240dab77c999de61b86be432 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 26 May 2024 12:13:12 -0500 Subject: [PATCH] Format CMD-K text --- src/components/CommandKClient.tsx | 4 ++-- src/site/CommandK.tsx | 3 ++- src/utility/string.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/CommandKClient.tsx b/src/components/CommandKClient.tsx index 61d6bd10..82a20a24 100644 --- a/src/components/CommandKClient.tsx +++ b/src/components/CommandKClient.tsx @@ -38,7 +38,7 @@ import { getKeywordsForPhoto, titleForPhoto } from '@/photo'; import PhotoDate from '@/photo/PhotoDate'; import PhotoSmall from '@/photo/PhotoSmall'; import { FaCheck } from 'react-icons/fa6'; -import { TagsWithMeta, addHiddenToTags } from '@/tag'; +import { TagsWithMeta, addHiddenToTags, formatTag } from '@/tag'; import { FaTag } from 'react-icons/fa'; import { formatCount, formatCountDescriptive } from '@/utility/string'; @@ -191,7 +191,7 @@ export default function CommandKClient({ className="translate-x-[1px] translate-y-[0.75px]" />, items: tagsIncludingHidden.map(({ tag, count }) => ({ - label: tag, + label: formatTag(tag), annotation: formatCount(count), annotationAria: formatCountDescriptive(count), path: pathForTag(tag), diff --git a/src/site/CommandK.tsx b/src/site/CommandK.tsx index 6e67186e..829f0f73 100644 --- a/src/site/CommandK.tsx +++ b/src/site/CommandK.tsx @@ -16,6 +16,7 @@ import { TagsWithMeta } from '@/tag'; import PhotoFilmSimulationIcon from '@/simulation/PhotoFilmSimulationIcon'; import { IoMdCamera } from 'react-icons/io'; import { ADMIN_DEBUG_TOOLS_ENABLED, SHOW_FILM_SIMULATIONS } from './config'; +import { labelForFilmSimulation } from '@/vendors/fujifilm'; export default async function CommandK() { const [ @@ -51,7 +52,7 @@ export default async function CommandK() { , items: filmSimulations.map(({ simulation, count }) => ({ - label: simulation, + label: labelForFilmSimulation(simulation).medium, annotation: formatCount(count), annotationAria: formatCountDescriptive(count), path: pathForFilmSimulation(simulation), diff --git a/src/utility/string.ts b/src/utility/string.ts index 8bad0cd2..145462a1 100644 --- a/src/utility/string.ts +++ b/src/utility/string.ts @@ -8,7 +8,7 @@ export const convertStringToArray = ( : undefined; export const capitalize = (string: string) => - string.charAt(0).toUpperCase() + string.slice(1); + string.charAt(0).toLocaleUpperCase() + string.slice(1); export const capitalizeWords = (string = '') => string