diff --git a/front/packages/primitives/src/chip.tsx b/front/packages/primitives/src/chip.tsx new file mode 100644 index 00000000..a2e75a5a --- /dev/null +++ b/front/packages/primitives/src/chip.tsx @@ -0,0 +1,45 @@ +/* + * 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 . + */ + +import { rem, Stylable, Theme, useYoshiki } from "yoshiki/native"; +import { P } from "./text"; +import { ts } from "./utils"; + +export const Chip = ({ label, color, ...props }: { label: string; color?: string } & Stylable) => { + const { css } = useYoshiki(); + + return ( +

theme.contrast, + bg: color ?? ((theme: Theme) => theme.accent), + }, + props, + )} + > + {label} +

+ ); +}; diff --git a/front/packages/primitives/src/index.ts b/front/packages/primitives/src/index.ts index dfad49fb..b665fcc8 100644 --- a/front/packages/primitives/src/index.ts +++ b/front/packages/primitives/src/index.ts @@ -34,6 +34,7 @@ export * from "./slider"; export * from "./menu"; export * from "./input"; export * from "./button"; +export * from "./chip"; export * from "./animated"; export * from "./utils"; diff --git a/front/packages/ui/src/browse/header.tsx b/front/packages/ui/src/browse/header.tsx index cbc5ba3c..49572029 100644 --- a/front/packages/ui/src/browse/header.tsx +++ b/front/packages/ui/src/browse/header.tsx @@ -18,9 +18,20 @@ * along with Kyoo. If not, see . */ -import { HR, Icon, IconButton, Menu, P, PressableFeedback, tooltip, ts } from "@kyoo/primitives"; +import { + Chip, + HR, + Icon, + IconButton, + Menu, + P, + PressableFeedback, + tooltip, + ts, +} from "@kyoo/primitives"; import { useTranslation } from "react-i18next"; import { useYoshiki } from "yoshiki/native"; +import Style from "@material-symbols/svg-400/rounded/style.svg"; import GridView from "@material-symbols/svg-400/rounded/grid_view.svg"; import ViewList from "@material-symbols/svg-400/rounded/view_list.svg"; import Sort from "@material-symbols/svg-400/rounded/sort.svg"; @@ -64,10 +75,19 @@ export const BrowseSettings = ({ }) => { const { css, theme } = useYoshiki(); const { t } = useTranslation(); + const filters: string[] = []; + // TODO: implement filters in the front. return ( - - + + {filters.length !== 0 && ( + + + {filters.map((x) => ( + + ))} + + )} {Object.values(SortBy).map((x) => (