mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Front: Fix use of Yoshiki
This commit is contained in:
parent
4aaba75c18
commit
fa969fa702
@ -181,7 +181,7 @@ export const WatchInfoP = z
|
||||
.transform((x) => {
|
||||
const hour = Math.floor(x.length / 3600);
|
||||
const minutes = Math.ceil((x.length % 3600) / 60);
|
||||
const duration = hour ? `${hour}h` : "" + `${minutes}m`;
|
||||
const duration = `${hour ? `${hour}h` : ""}${minutes}m`;
|
||||
return {
|
||||
...x,
|
||||
duration,
|
||||
|
@ -23,16 +23,15 @@ import { Button, HR, P, Popup, Skeleton } from "@kyoo/primitives";
|
||||
import { Fetch } from "../fetch";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
import { NativeCssFunc } from "yoshiki/src/native/type";
|
||||
import { useYoshiki } from "yoshiki/native";
|
||||
|
||||
const MediaInfoTable = ({
|
||||
mediaInfo: { path, video, container, audios, subtitles, duration },
|
||||
css,
|
||||
}: {
|
||||
css: NativeCssFunc;
|
||||
mediaInfo: Partial<WatchInfo>;
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { css } = useYoshiki();
|
||||
const formatBitrate = (b: number) => `${(b / 1000000).toFixed(2)} Mbps`;
|
||||
const formatTrackTable = (trackTable: (Audio | Subtitle)[], s: string) => {
|
||||
if (trackTable.length == 0) {
|
||||
@ -117,7 +116,7 @@ export const MediaInfoPopup = ({
|
||||
{({ css }) => (
|
||||
<>
|
||||
<Fetch query={mediaInfoQuery}>
|
||||
{(mediaInfo) => <MediaInfoTable css={css} mediaInfo={mediaInfo} />}
|
||||
{(mediaInfo) => <MediaInfoTable mediaInfo={mediaInfo} />}
|
||||
</Fetch>
|
||||
<Button text="OK" onPress={() => close()} />
|
||||
</>
|
||||
|
Loading…
x
Reference in New Issue
Block a user