Differenciate metadata and info skeletons of the player

This commit is contained in:
Zoe Roux 2023-11-08 21:06:06 +01:00
parent a1aa71e271
commit ead8a44fe0
3 changed files with 7 additions and 7 deletions

View File

@ -23,7 +23,7 @@ import { Props, YoshikiEnhanced } from "./base-image";
import { Image } from "./image"; import { Image } from "./image";
import { ComponentType, ReactNode } from "react"; import { ComponentType, ReactNode } from "react";
import { LinearGradient, LinearGradientProps } from "expo-linear-gradient"; import { LinearGradient, LinearGradientProps } from "expo-linear-gradient";
import { ContrastArea, alpha } from "../themes"; import { ContrastArea } from "../themes";
import { percent } from "yoshiki/native"; import { percent } from "yoshiki/native";
export { BlurhashContainer } from "./blurhash"; export { BlurhashContainer } from "./blurhash";

View File

@ -19,7 +19,7 @@
*/ */
import { forwardRef, ReactNode, useState } from "react"; import { forwardRef, ReactNode, useState } from "react";
import { Platform, TextInput, TextInputProps, View } from "react-native"; import { TextInput, TextInputProps, View } from "react-native";
import { px, Theme, useYoshiki } from "yoshiki/native"; import { px, Theme, useYoshiki } from "yoshiki/native";
import { focusReset, ts } from "./utils"; import { focusReset, ts } from "./utils";

View File

@ -69,17 +69,17 @@ const mapData = (
previousSlug?: string, previousSlug?: string,
nextSlug?: string, nextSlug?: string,
): Partial<ComponentProps<typeof Hover>> & { isLoading: boolean } => { ): Partial<ComponentProps<typeof Hover>> & { isLoading: boolean } => {
if (!data || !info) return { isLoading: true }; if (!data) return { isLoading: true };
return { return {
isLoading: false, isLoading: false,
name: data.type === "movie" ? data.name : `${episodeDisplayNumber(data, "")} ${data.name}`, name: data.type === "movie" ? data.name : `${episodeDisplayNumber(data, "")} ${data.name}`,
showName: data.type === "movie" ? data.name! : data.show!.name, showName: data.type === "movie" ? data.name! : data.show!.name,
href: data ? (data.type === "movie" ? `/movie/${data.slug}` : `/show/${data.show!.slug}`) : "#", href: data ? (data.type === "movie" ? `/movie/${data.slug}` : `/show/${data.show!.slug}`) : "#",
poster: data.type === "movie" ? data.poster : data.show!.poster, poster: data.type === "movie" ? data.poster : data.show!.poster,
subtitles: info.subtitles, subtitles: info?.subtitles,
audios: info.audios, audios: info?.audios,
chapters: info.chapters, chapters: info?.chapters,
fonts: info.fonts, fonts: info?.fonts,
previousSlug, previousSlug,
nextSlug, nextSlug,
}; };