diff --git a/front/packages/primitives/src/chip.tsx b/front/packages/primitives/src/chip.tsx index 5a7be16db3..a5a22bb148 100644 --- a/front/packages/primitives/src/chip.tsx +++ b/front/packages/primitives/src/chip.tsx @@ -50,12 +50,12 @@ export const Chip = ({ [ { pY: ts(1 * sizeMult), - pX: ts(1.5 * sizeMult), + pX: ts(2.5 * sizeMult), borderRadius: ts(3), fontSize: rem(0.8), }, !outline && { - color: (theme: Theme) => theme.contrast, + color: (theme: Theme) => theme.alternate.contrast, bg: color ?? ((theme: Theme) => theme.accent), }, outline && { diff --git a/front/packages/primitives/src/utils/capitalize.ts b/front/packages/primitives/src/utils/capitalize.ts new file mode 100644 index 0000000000..6929583d65 --- /dev/null +++ b/front/packages/primitives/src/utils/capitalize.ts @@ -0,0 +1,31 @@ +/* + * Kyoo - A portable and vast media library solution. + * Copyright (c) Kyoo. + * + * See AUTHORS.md and LICENSE file in the project root for full license information. + * + * Kyoo is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * Kyoo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Kyoo. If not, see . + */ + +export const capitalize = (str: string): string => { + return str.split(' ') + .map((s) => s.trim()) + .map((s) => { + if (s.length > 1) { + return s.charAt(0).toUpperCase() + s.slice(1); + } + return s + }) + .join(' ') +} \ No newline at end of file diff --git a/front/packages/primitives/src/utils/index.tsx b/front/packages/primitives/src/utils/index.tsx index fb9cd22093..e36a7e6e63 100644 --- a/front/packages/primitives/src/utils/index.tsx +++ b/front/packages/primitives/src/utils/index.tsx @@ -22,3 +22,4 @@ export * from "./breakpoints"; export * from "./nojs"; export * from "./head"; export * from "./spacing"; +export * from "./capitalize"; diff --git a/front/packages/ui/src/details/header.tsx b/front/packages/ui/src/details/header.tsx index 9458de0690..9602563317 100644 --- a/front/packages/ui/src/details/header.tsx +++ b/front/packages/ui/src/details/header.tsx @@ -73,6 +73,8 @@ import { Rating } from "../components/rating"; import { EpisodeLine, displayRuntime, episodeDisplayNumber } from "./episode"; import { WatchListInfo } from "../components/watchlist-info"; import { ShowWatchStatus, WatchStatusV } from "@kyoo/models/src/resources/watch-status"; +import { PartOf } from "./collection"; +import { capitalize } from '@kyoo/primitives' export const TitleLine = ({ isLoading, @@ -366,7 +368,7 @@ const Description = ({ >

{t("show.tags")}:

{(isLoading ? [...Array(3)] : tags!).map((tag, i) => ( - + ))} @@ -472,7 +474,7 @@ export const Header = ({ }, }) as any)} > - {data ? name : } + {data ? capitalize(name) : } ))}