diff --git a/front/apps/mobile/package.json b/front/apps/mobile/package.json index cd32b8cf..9ae225e1 100644 --- a/front/apps/mobile/package.json +++ b/front/apps/mobile/package.json @@ -52,7 +52,7 @@ "react-native-svg": "13.9.0", "react-native-uuid": "^2.0.1", "react-native-video": "^6.0.0-alpha.7", - "yoshiki": "1.2.9" + "yoshiki": "1.2.12" }, "devDependencies": { "@babel/core": "^7.22.10", diff --git a/front/apps/web/package.json b/front/apps/web/package.json index 6a452412..9cb14bc6 100644 --- a/front/apps/web/package.json +++ b/front/apps/web/package.json @@ -39,7 +39,7 @@ "srt-webvtt": "^2.0.0", "superjson": "^1.13.1", "sweetalert2": "^11.7.20", - "yoshiki": "1.2.9", + "yoshiki": "1.2.12", "zod": "^3.21.4" }, "devDependencies": { diff --git a/front/packages/primitives/src/icons.tsx b/front/packages/primitives/src/icons.tsx index ba3d112a..aa73c03a 100644 --- a/front/packages/primitives/src/icons.tsx +++ b/front/packages/primitives/src/icons.tsx @@ -21,7 +21,7 @@ import React, { ComponentProps, ComponentType, ForwardedRef, forwardRef } from "react"; import { Platform, PressableProps, ViewStyle } from "react-native"; import { SvgProps } from "react-native-svg"; -import { YoshikiStyle } from "yoshiki/src/type"; +import { YoshikiStyle } from "yoshiki"; import { px, Theme, useYoshiki } from "yoshiki/native"; import { PressableFeedback } from "./links"; import { alpha } from "./themes"; diff --git a/front/packages/primitives/src/image/blurhash.web.tsx b/front/packages/primitives/src/image/blurhash.web.tsx index 338f5e76..ce54e181 100644 --- a/front/packages/primitives/src/image/blurhash.web.tsx +++ b/front/packages/primitives/src/image/blurhash.web.tsx @@ -21,7 +21,7 @@ import { decode } from "blurhash"; import { ReactElement } from "react"; import { useYoshiki } from "yoshiki"; -import { Stylable } from "yoshiki/native"; +import { Stylable, nativeStyleToCss } from "yoshiki/native"; import { StyleList, processStyleList } from "yoshiki/src/type"; // The blurhashToUrl has been stolen from https://gist.github.com/mattiaz9/53cb67040fa135cb395b1d015a200aff @@ -191,28 +191,19 @@ function generatePng(width: number, height: number, rgbaString: string) { return pngString; } -// Extract classnames from leftover props using yoshiki's internal. -const extractClassNames = (props: { - style?: StyleList<{ $$css?: true; yoshiki?: string } | Style>; -}) => { - const inline = processStyleList(props.style); - return "$$css" in inline && inline.$$css ? inline.yoshiki : undefined; -}; - export const BlurhashContainer = ({ blurhash, children, ...props -}: { blurhash: string; children?: ReactElement | ReactElement[] } & Stylable) => { +}: { + blurhash: string; + children?: ReactElement | ReactElement[]; +}) => { const { css } = useYoshiki(); return (
{children} diff --git a/front/packages/ui/src/browse/list.tsx b/front/packages/ui/src/browse/list.tsx index ffae63c7..28652840 100644 --- a/front/packages/ui/src/browse/list.tsx +++ b/front/packages/ui/src/browse/list.tsx @@ -65,6 +65,7 @@ export const ItemList = ({ flexDirection: "row", height: ItemList.layout.size, borderRadius: px(6), + marginX: ItemList.layout.gap, })} > ({ @@ -83,12 +83,12 @@ const InfiniteScroll = ({ gridAutoRows: "max-content", // the as any is due to differencies between css types of native and web (already accounted for in yoshiki) gridGap: layout.gap as any, - padding: layout.gap as any, }, layout.layout == "vertical" && { gridTemplateColumns: "1fr", alignItems: "stretch", overflowY: "auto", + paddingY: layout.gap as any, }, layout.layout == "horizontal" && { alignItems: "stretch", @@ -97,16 +97,17 @@ const InfiniteScroll = ({ gridAutoFlow: "column", gridAutoColumns: ysMap(layout.numColumns, (x) => `${100 / x}%`), gridTemplateRows: "max-content", + paddingX: layout.gap as any, }, layout.layout === "grid" && { gridTemplateColumns: ysMap(layout.numColumns, (x) => `repeat(${x}, 1fr)`), justifyContent: "center", alignItems: "flex-start", overflowY: "auto", + padding: layout.gap as any, }, ], - - props, + nativeStyleToCss(props), )} > {children} diff --git a/front/packages/ui/src/home/genre.tsx b/front/packages/ui/src/home/genre.tsx index cd9b6289..33432f6b 100644 --- a/front/packages/ui/src/home/genre.tsx +++ b/front/packages/ui/src/home/genre.tsx @@ -29,7 +29,7 @@ import { import { H3, IconButton, ts } from "@kyoo/primitives"; import { ReactElement, forwardRef, useRef } from "react"; import { View } from "react-native"; -import { useYoshiki } from "yoshiki/native"; +import { px, useYoshiki } from "yoshiki/native"; import { ItemGrid } from "../browse/grid"; import ChevronLeft from "@material-symbols/svg-400/rounded/chevron_left-fill.svg"; import ChevronRight from "@material-symbols/svg-400/rounded/chevron_right-fill.svg"; @@ -45,18 +45,26 @@ const Header = forwardRef< return ( {!(empty && !displayEmpty) && ( - +

{genre}

- - ref.current?.scrollTo({ x: 0, animated: true })} - /> - ref.current?.scrollTo({ x: 0, animated: true })} - /> - + {/* */} + {/* ref.current?.scrollTo({ x: 0, animated: true })} */} + {/* /> */} + {/* ref.current?.scrollTo({ x: 0, animated: true })} */} + {/* /> */} + {/* */}
)} {children} diff --git a/front/packages/ui/src/home/recommanded.tsx b/front/packages/ui/src/home/recommanded.tsx index c97efbb1..9b50f429 100644 --- a/front/packages/ui/src/home/recommanded.tsx +++ b/front/packages/ui/src/home/recommanded.tsx @@ -50,6 +50,7 @@ import { Theme, calc, percent, px, rem, useYoshiki } from "yoshiki/native"; import { Fetch, Layout, WithLoading } from "../fetch"; import { InfiniteFetch } from "../fetch-infinite"; import PlayArrow from "@material-symbols/svg-400/rounded/play_arrow-fill.svg"; +import { ItemGrid } from "../browse/grid"; export const ItemDetails = ({ isLoading, @@ -165,9 +166,13 @@ export const Recommanded = () => { const { css } = useYoshiki(); return ( - -

{t("home.recommanded")}

- + +

{t("home.recommanded")}

+ {(x, i) => ( . */ -import { - ItemKind, - LibraryItem, - LibraryItemP, - QueryIdentifier, - getDisplayDate, -} from "@kyoo/models"; +import { ItemKind, LibraryItem, LibraryItemP, QueryIdentifier, getDisplayDate } from "@kyoo/models"; import { H3, ts } from "@kyoo/primitives"; import { View } from "react-native"; import { useYoshiki } from "yoshiki/native"; import { InfiniteFetch } from "../fetch-infinite"; import { ItemList } from "../browse/list"; import { useTranslation } from "react-i18next"; +import { ItemGrid } from "../browse/grid"; export const VerticalRecommanded = () => { const { t } = useTranslation(); const { css } = useYoshiki(); return ( - -

{t("home.recommanded")}

+ +

{t("home.recommanded")}