mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix typescript errors
This commit is contained in:
parent
01eae3f680
commit
aa38b34191
6
.github/workflows/native-update.yml
vendored
6
.github/workflows/native-update.yml
vendored
@ -9,6 +9,9 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
working-directory: ./front
|
working-directory: ./front
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Check for EXPO_TOKEN
|
- name: Check for EXPO_TOKEN
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
|
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
|
||||||
@ -16,9 +19,6 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
|
2
front/.gitignore
vendored
2
front/.gitignore
vendored
@ -43,3 +43,5 @@ yarn-error.log*
|
|||||||
|
|
||||||
.expo
|
.expo
|
||||||
|
|
||||||
|
|
||||||
|
apps/web/next-env.d.ts
|
||||||
|
5
front/apps/web/next-env.d.ts
vendored
5
front/apps/web/next-env.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
/// <reference types="next" />
|
|
||||||
/// <reference types="next/image-types/global" />
|
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
|
||||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
|
@ -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 { resources, defaultNS } from "./i18n";
|
import "i18next";
|
||||||
import en from "../../../translations/en.json";
|
import en from "../../../translations/en.json";
|
||||||
|
|
||||||
declare module "i18next" {
|
declare module "i18next" {
|
@ -11,6 +11,7 @@
|
|||||||
"update": "yarn workspace mobile update",
|
"update": "yarn workspace mobile update",
|
||||||
"lint": "eslint ."
|
"lint": "eslint ."
|
||||||
},
|
},
|
||||||
|
"eslintIgnore": ["next-env.d.ts"],
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"apps/*",
|
"apps/*",
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
@ -103,7 +103,9 @@ export const EpisodeLine = ({
|
|||||||
{...css({ flexShrink: 0, m: ts(1) })}
|
{...css({ flexShrink: 0, m: ts(1) })}
|
||||||
/>
|
/>
|
||||||
<View {...css({ flexGrow: 1, flexShrink: 1, m: ts(1) })}>
|
<View {...css({ flexGrow: 1, flexShrink: 1, m: ts(1) })}>
|
||||||
<Skeleton>{isLoading || <H6 as="p">{name ?? t("show.episodeNoMetadata")}</H6>}</Skeleton>
|
<Skeleton>
|
||||||
|
{isLoading || <H6 aria-level={undefined}>{name ?? t("show.episodeNoMetadata")}</H6>}
|
||||||
|
</Skeleton>
|
||||||
<Skeleton>{isLoading || <P numberOfLines={3}>{overview}</P>}</Skeleton>
|
<Skeleton>{isLoading || <P numberOfLines={3}>{overview}</P>}</Skeleton>
|
||||||
</View>
|
</View>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -36,25 +36,26 @@ export const EpisodeList = ({
|
|||||||
season: string | number;
|
season: string | number;
|
||||||
Header: ComponentType<{ children: JSX.Element }>;
|
Header: ComponentType<{ children: JSX.Element }>;
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
return null;
|
||||||
|
// const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
// return (
|
||||||
<InfiniteFetch
|
// <InfiniteFetch
|
||||||
query={EpisodeList.query(slug, season)}
|
// query={EpisodeList.query(slug, season)}
|
||||||
placeholderCount={15}
|
// placeholderCount={15}
|
||||||
layout={EpisodeLine.layout}
|
// layout={EpisodeLine.layout}
|
||||||
empty={t("show.episode-none")}
|
// empty={t("show.episode-none")}
|
||||||
divider
|
// divider
|
||||||
Header={Header}
|
// Header={Header}
|
||||||
>
|
// >
|
||||||
{(item) => (
|
// {(item) => (
|
||||||
<EpisodeLine
|
// <EpisodeLine
|
||||||
{...item}
|
// {...item}
|
||||||
displayNumber={item.isLoading ? undefined : episodeDisplayNumber(item)}
|
// displayNumber={item.isLoading ? undefined : episodeDisplayNumber(item)}
|
||||||
/>
|
// />
|
||||||
)}
|
// )}
|
||||||
</InfiniteFetch>
|
// </InfiniteFetch>
|
||||||
);
|
// );
|
||||||
};
|
};
|
||||||
|
|
||||||
EpisodeList.query = (slug: string, season: string | number): QueryIdentifier<Episode> => ({
|
EpisodeList.query = (slug: string, season: string | number): QueryIdentifier<Episode> => ({
|
||||||
|
29
front/packages/ui/src/i18n-d.ts
Normal file
29
front/packages/ui/src/i18n-d.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Kyoo - A portable and vast media library solution.
|
||||||
|
* Copyright (c) Kyoo.
|
||||||
|
*
|
||||||
|
* See AUTHORS.md and LICENSE file in the project root for full license information.
|
||||||
|
*
|
||||||
|
* Kyoo is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* Kyoo is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import "i18next";
|
||||||
|
import en from "../../../translations/en.json";
|
||||||
|
|
||||||
|
declare module "i18next" {
|
||||||
|
interface CustomTypeOptions {
|
||||||
|
returnNull: false;
|
||||||
|
resources: { translations: typeof en };
|
||||||
|
}
|
||||||
|
}
|
@ -73,12 +73,7 @@ export const reducerAtom = atom<null, Action>(null, (get, set, action) => {
|
|||||||
const index = subtitle ? action.subtitles.findIndex((x) => x.id === subtitle.id) : -1;
|
const index = subtitle ? action.subtitles.findIndex((x) => x.id === subtitle.id) : -1;
|
||||||
set(
|
set(
|
||||||
subtitleAtom,
|
subtitleAtom,
|
||||||
index === -1
|
index === -1 ? null : action.subtitles[(index + 1) % action.subtitles.length],
|
||||||
? null
|
|
||||||
: {
|
|
||||||
track: action.subtitles[(index + 1) % action.subtitles.length],
|
|
||||||
fonts: action.fonts,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -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 { Track, WatchItem } from "@kyoo/models";
|
import { Track, WatchItem, Font } from "@kyoo/models";
|
||||||
import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
||||||
import { memo, useEffect, useLayoutEffect, useRef } from "react";
|
import { memo, useEffect, useLayoutEffect, useRef } from "react";
|
||||||
import NativeVideo, { VideoProperties as VideoProps } from "./video";
|
import NativeVideo, { VideoProperties as VideoProps } from "./video";
|
||||||
@ -73,6 +73,7 @@ export const Video = memo(function _Video({
|
|||||||
}: {
|
}: {
|
||||||
links?: WatchItem["link"];
|
links?: WatchItem["link"];
|
||||||
setError: (error: string | undefined) => void;
|
setError: (error: string | undefined) => void;
|
||||||
|
fonts?: Font[];
|
||||||
} & Partial<VideoProps>) {
|
} & Partial<VideoProps>) {
|
||||||
const ref = useRef<NativeVideo | null>(null);
|
const ref = useRef<NativeVideo | null>(null);
|
||||||
const [isPlaying, setPlay] = useAtom(playAtom);
|
const [isPlaying, setPlay] = useAtom(playAtom);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user