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