Format code

This commit is contained in:
Zoe Roux 2024-05-20 22:18:10 +02:00
parent f3fb96504a
commit bb14d9944a
No known key found for this signature in database
7 changed files with 9 additions and 9 deletions

View File

@ -23,8 +23,8 @@ import { type ComponentType, type RefAttributes, forwardRef } from "react";
import { Image, type ImageProps, View, type ViewStyle } from "react-native"; import { Image, type ImageProps, View, type ViewStyle } from "react-native";
import { type Stylable, px, useYoshiki } from "yoshiki/native"; import { type Stylable, px, useYoshiki } from "yoshiki/native";
import { Icon } from "./icons"; import { Icon } from "./icons";
import { P } from "./text";
import { Skeleton } from "./skeleton"; import { Skeleton } from "./skeleton";
import { P } from "./text";
const stringToColor = (string: string) => { const stringToColor = (string: string) => {
let hash = 0; let hash = 0;
@ -124,4 +124,4 @@ const AvatarLoader = ({ size = px(24), ...props }: { size?: number }) => {
); );
}; };
export const Avatar = { ...AvatarC, Loader: AvatarLoader }; export const Avatar = Object.assign(AvatarC, { Loader: AvatarLoader });

View File

@ -18,7 +18,7 @@
* along with Kyoo. If not, see <https://www.gnu.org/licenses/>. * along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { View, type TextProps } from "react-native"; import { type TextProps, View } from "react-native";
import { type Theme, px, rem, useYoshiki } from "yoshiki/native"; import { type Theme, px, rem, useYoshiki } from "yoshiki/native";
import { Link } from "./links"; import { Link } from "./links";
import { Skeleton } from "./skeleton"; import { Skeleton } from "./skeleton";

View File

@ -19,7 +19,7 @@
*/ */
import { getCurrentToken } from "@kyoo/models"; import { getCurrentToken } from "@kyoo/models";
import { ReactElement, useState } from "react"; import { type ReactElement, useState } from "react";
import { type FlexStyle, type ImageStyle, View, type ViewStyle } from "react-native"; import { type FlexStyle, type ImageStyle, View, type ViewStyle } from "react-native";
import { Blurhash } from "react-native-blurhash"; import { Blurhash } from "react-native-blurhash";
import FastImage from "react-native-fast-image"; import FastImage from "react-native-fast-image";

View File

@ -19,7 +19,7 @@
*/ */
import NextImage from "next/image"; import NextImage from "next/image";
import { ReactElement, useState } from "react"; import { type ReactElement, useState } from "react";
import { type ImageStyle, View, type ViewStyle } from "react-native"; import { type ImageStyle, View, type ViewStyle } from "react-native";
import { useYoshiki } from "yoshiki/native"; import { useYoshiki } from "yoshiki/native";
import { imageBorderRadius } from "../constants"; import { imageBorderRadius } from "../constants";
@ -74,7 +74,7 @@ export const Image = ({
); );
}; };
Image.Loader = ({ layout, ...props }: { layout: ImageLayout, children?: ReactElement }) => { Image.Loader = ({ layout, ...props }: { layout: ImageLayout; children?: ReactElement }) => {
const { css } = useYoshiki(); const { css } = useYoshiki();
const border = { borderRadius: 6, overflow: "hidden" } satisfies ViewStyle; const border = { borderRadius: 6, overflow: "hidden" } satisfies ViewStyle;

View File

@ -43,7 +43,7 @@ Poster.Loader = ({
layout, layout,
...props ...props
}: { }: {
children?: ReactElement; children?: ReactElement;
layout: YoshikiEnhanced<{ width: ImageStyle["width"] } | { height: ImageStyle["height"] }>; layout: YoshikiEnhanced<{ width: ImageStyle["width"] } | { height: ImageStyle["height"] }>;
}) => <Image.Loader layout={{ aspectRatio: 2 / 3, ...layout }} {...props} />; }) => <Image.Loader layout={{ aspectRatio: 2 / 3, ...layout }} {...props} />;

View File

@ -33,11 +33,11 @@ import {
} from "@kyoo/primitives"; } from "@kyoo/primitives";
import { useState } from "react"; import { useState } from "react";
import { Platform, View } from "react-native"; import { Platform, View } from "react-native";
import type { Stylable } from "yoshiki";
import { percent, px, rem, useYoshiki } from "yoshiki/native"; import { percent, px, rem, useYoshiki } from "yoshiki/native";
import { ItemContext } from "../components/context-menus"; import { ItemContext } from "../components/context-menus";
import type { Layout } from "../fetch"; import type { Layout } from "../fetch";
import { ItemWatchStatus } from "./grid"; import { ItemWatchStatus } from "./grid";
import type { Stylable } from "yoshiki";
export const ItemList = ({ export const ItemList = ({
href, href,

View File

@ -22,6 +22,7 @@ import { type KyooImage, WatchStatusV } from "@kyoo/models";
import { import {
H6, H6,
IconButton, IconButton,
Image,
ImageBackground, ImageBackground,
type ImageProps, type ImageProps,
Link, Link,
@ -32,7 +33,6 @@ import {
important, important,
tooltip, tooltip,
ts, ts,
Image,
} from "@kyoo/primitives"; } from "@kyoo/primitives";
import ExpandMore from "@material-symbols/svg-400/rounded/keyboard_arrow_down-fill.svg"; import ExpandMore from "@material-symbols/svg-400/rounded/keyboard_arrow_down-fill.svg";
import ExpandLess from "@material-symbols/svg-400/rounded/keyboard_arrow_up-fill.svg"; import ExpandLess from "@material-symbols/svg-400/rounded/keyboard_arrow_up-fill.svg";