mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
wip: Add browse page
This commit is contained in:
parent
9fbddd7b58
commit
8de7f20ac9
@ -21,10 +21,11 @@ export const expo: ExpoConfig = {
|
|||||||
foregroundImage: "./public/icon-256x256.png",
|
foregroundImage: "./public/icon-256x256.png",
|
||||||
backgroundColor: "#eff1f5",
|
backgroundColor: "#eff1f5",
|
||||||
},
|
},
|
||||||
|
edgeToEdgeEnabled: true,
|
||||||
},
|
},
|
||||||
web: {
|
web: {
|
||||||
favicon: "./public/icon-256x256.png",
|
favicon: "./public/icon-256x256.png",
|
||||||
bundler: "metro"
|
bundler: "metro",
|
||||||
},
|
},
|
||||||
updates: {
|
updates: {
|
||||||
url: "https://u.expo.dev/55de6b52-c649-4a15-9a45-569ff5ed036c",
|
url: "https://u.expo.dev/55de6b52-c649-4a15-9a45-569ff5ed036c",
|
||||||
|
@ -1,29 +1,9 @@
|
|||||||
/*
|
|
||||||
* 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 { Icon } from "@kyoo/primitives";
|
|
||||||
import Browse from "@material-symbols/svg-400/rounded/browse-fill.svg";
|
import Browse from "@material-symbols/svg-400/rounded/browse-fill.svg";
|
||||||
import Downloading from "@material-symbols/svg-400/rounded/downloading-fill.svg";
|
import Downloading from "@material-symbols/svg-400/rounded/downloading-fill.svg";
|
||||||
import Home from "@material-symbols/svg-400/rounded/home-fill.svg";
|
import Home from "@material-symbols/svg-400/rounded/home-fill.svg";
|
||||||
import { Tabs } from "expo-router";
|
import { Tabs } from "expo-router";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { Icon } from "~/primitives";
|
||||||
|
|
||||||
export default function TabsLayout() {
|
export default function TabsLayout() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
3
front/app/(app)/(tabs)/browse.tsx
Normal file
3
front/app/(app)/(tabs)/browse.tsx
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { BrowsePage } from "~/ui/browse";
|
||||||
|
|
||||||
|
export default BrowsePage;
|
@ -12,8 +12,10 @@ export default function Layout() {
|
|||||||
<ErrorConsumer scope="app">
|
<ErrorConsumer scope="app">
|
||||||
<Stack
|
<Stack
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
navigationBarColor: "transparent",
|
// navigationBarColor: "transparent",
|
||||||
navigationBarTranslucent: true,
|
// navigationBarTranslucent: true,
|
||||||
|
// statusBarTranslucent: true,
|
||||||
|
// statusBarBackgroundColor: theme.accent,
|
||||||
headerTitle: () => <NavbarTitle />,
|
headerTitle: () => <NavbarTitle />,
|
||||||
headerRight: () => <NavbarRight />,
|
headerRight: () => <NavbarRight />,
|
||||||
contentStyle: {
|
contentStyle: {
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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 { BrowsePage } from "@kyoo/ui";
|
|
||||||
|
|
||||||
export default BrowsePage;
|
|
2
front/i18n-d.d.ts
vendored
2
front/i18n-d.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import "i18next";
|
import "i18next";
|
||||||
import type en from "./public/translations/en.json";
|
import type en from "../public/translations/en.json";
|
||||||
|
|
||||||
declare module "i18next" {
|
declare module "i18next" {
|
||||||
interface CustomTypeOptions {
|
interface CustomTypeOptions {
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
export * from "../../../src/ui/navbar";
|
|
||||||
export { HomePage } from "./home";
|
|
||||||
export { BrowsePage } from "./browse";
|
|
||||||
export { MovieDetails, ShowDetails } from "./details";
|
|
||||||
export { CollectionPage } from "./collection";
|
|
||||||
export { Player } from "./player";
|
|
||||||
export { SearchPage } from "./search";
|
|
||||||
export { ServerUrlPage, LoginPage, RegisterPage, OidcCallbackPage } from "../../../src/ui/login";
|
|
||||||
export { DownloadPage, DownloadProvider } from "./downloads";
|
|
||||||
export { SettingsPage } from "./settings";
|
|
||||||
export { AdminPage } from "./admin";
|
|
||||||
export * from "../../../src/ui/errors";
|
|
26
front/packages/ui/src/svg.d.ts
vendored
26
front/packages/ui/src/svg.d.ts
vendored
@ -1,26 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare module "*.svg" {
|
|
||||||
import type React from "react";
|
|
||||||
import type { SvgProps } from "react-native-svg";
|
|
||||||
const content: React.FC<SvgProps>;
|
|
||||||
export default content;
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
import "i18next";
|
import "i18next";
|
||||||
import type en from "./public/translations/en.json";
|
import type en from "../public/translations/en.json";
|
||||||
|
|
||||||
declare module "i18next" {
|
declare module "i18next" {
|
||||||
interface CustomTypeOptions {
|
interface CustomTypeOptions {
|
@ -106,13 +106,13 @@ export const createQueryClient = () =>
|
|||||||
retry: false,
|
retry: false,
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
mutationFn: (({ method, path, body, params }: MutationParam) => {
|
// mutationFn: (({ method, path, body, params }: MutationParam) => {
|
||||||
return queryFn({
|
// return queryFn({
|
||||||
method,
|
// method,
|
||||||
path: toQueryKey({ path, params }),
|
// url: keyToUrl(toQueryKey({ path, params })),
|
||||||
body,
|
// body,
|
||||||
});
|
// });
|
||||||
}) as any,
|
// }) as any,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -147,6 +147,10 @@ export const toQueryKey = (query: {
|
|||||||
].filter((x) => x);
|
].filter((x) => x);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const keyToUrl = (key: ReturnType<typeof toQueryKey>) => {
|
||||||
|
return key.join("/").replace("/?", "?");
|
||||||
|
};
|
||||||
|
|
||||||
export const useFetch = <Data,>(query: QueryIdentifier<Data>) => {
|
export const useFetch = <Data,>(query: QueryIdentifier<Data>) => {
|
||||||
const { apiUrl, authToken } = useContext(AccountContext);
|
const { apiUrl, authToken } = useContext(AccountContext);
|
||||||
const key = toQueryKey({ apiUrl, path: query.path, params: query.params });
|
const key = toQueryKey({ apiUrl, path: query.path, params: query.params });
|
||||||
@ -155,7 +159,7 @@ export const useFetch = <Data,>(query: QueryIdentifier<Data>) => {
|
|||||||
queryKey: key,
|
queryKey: key,
|
||||||
queryFn: (ctx) =>
|
queryFn: (ctx) =>
|
||||||
queryFn({
|
queryFn({
|
||||||
url: key.join("/").replace("/?", "?"),
|
url: keyToUrl(key),
|
||||||
parser: query.parser,
|
parser: query.parser,
|
||||||
signal: ctx.signal,
|
signal: ctx.signal,
|
||||||
authToken: authToken?.access_token ?? null,
|
authToken: authToken?.access_token ?? null,
|
||||||
@ -174,7 +178,7 @@ export const useInfiniteFetch = <Data, Ret>(query: QueryIdentifier<Data, Ret>) =
|
|||||||
queryKey: key,
|
queryKey: key,
|
||||||
queryFn: (ctx) =>
|
queryFn: (ctx) =>
|
||||||
queryFn({
|
queryFn({
|
||||||
url: (ctx.pageParam as string) ?? key.join("/").replace("/?", "?"),
|
url: (ctx.pageParam as string) ?? keyToUrl(key),
|
||||||
parser: Paged(query.parser),
|
parser: Paged(query.parser),
|
||||||
signal: ctx.signal,
|
signal: ctx.signal,
|
||||||
authToken: authToken?.access_token ?? null,
|
authToken: authToken?.access_token ?? null,
|
||||||
@ -214,7 +218,7 @@ export const prefetch = async (...queries: QueryIdentifier[]) => {
|
|||||||
queryKey: key,
|
queryKey: key,
|
||||||
queryFn: (ctx) =>
|
queryFn: (ctx) =>
|
||||||
queryFn({
|
queryFn({
|
||||||
url: key.join("/").replace("/?", "?"),
|
url: keyToUrl(key),
|
||||||
parser: Paged(query.parser),
|
parser: Paged(query.parser),
|
||||||
signal: ctx.signal,
|
signal: ctx.signal,
|
||||||
authToken: authToken?.access_token ?? null,
|
authToken: authToken?.access_token ?? null,
|
||||||
@ -227,7 +231,7 @@ export const prefetch = async (...queries: QueryIdentifier[]) => {
|
|||||||
queryKey: key,
|
queryKey: key,
|
||||||
queryFn: (ctx) =>
|
queryFn: (ctx) =>
|
||||||
queryFn({
|
queryFn({
|
||||||
url: key.join("/").replace("/?", "?"),
|
url: keyToUrl(key),
|
||||||
parser: query.parser,
|
parser: query.parser,
|
||||||
signal: ctx.signal,
|
signal: ctx.signal,
|
||||||
authToken: authToken?.access_token ?? null,
|
authToken: authToken?.access_token ?? null,
|
||||||
|
@ -1,23 +1,3 @@
|
|||||||
/*
|
|
||||||
* 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 { type KyooImage, WatchStatusV } from "@kyoo/models";
|
import { type KyooImage, WatchStatusV } from "@kyoo/models";
|
||||||
import {
|
import {
|
||||||
Icon,
|
Icon,
|
||||||
@ -35,7 +15,7 @@ import Done from "@material-symbols/svg-400/rounded/check-fill.svg";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { type ImageStyle, Platform, View } from "react-native";
|
import { type ImageStyle, Platform, View } from "react-native";
|
||||||
import { type Stylable, type Theme, max, percent, px, rem, useYoshiki } from "yoshiki/native";
|
import { type Stylable, type Theme, max, percent, px, rem, useYoshiki } from "yoshiki/native";
|
||||||
import { ItemContext } from "../components/context-menus";
|
import { ItemContext } from "../../../packages/ui/src/components/context-menus";
|
||||||
import type { Layout } from "../fetch";
|
import type { Layout } from "../fetch";
|
||||||
|
|
||||||
export const ItemWatchStatus = ({
|
export const ItemWatchStatus = ({
|
@ -1,23 +1,3 @@
|
|||||||
/*
|
|
||||||
* 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 { HR, Icon, IconButton, Menu, P, PressableFeedback, tooltip, ts } from "@kyoo/primitives";
|
import { HR, Icon, IconButton, Menu, P, PressableFeedback, tooltip, ts } from "@kyoo/primitives";
|
||||||
import ArrowDownward from "@material-symbols/svg-400/rounded/arrow_downward.svg";
|
import ArrowDownward from "@material-symbols/svg-400/rounded/arrow_downward.svg";
|
||||||
import ArrowUpward from "@material-symbols/svg-400/rounded/arrow_upward.svg";
|
import ArrowUpward from "@material-symbols/svg-400/rounded/arrow_upward.svg";
|
@ -1,34 +1,13 @@
|
|||||||
/*
|
import { type ComponentProps, useState } from "react";
|
||||||
* 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 {
|
import {
|
||||||
type LibraryItem,
|
type LibraryItem,
|
||||||
LibraryItemP,
|
LibraryItemP,
|
||||||
type QueryIdentifier,
|
type QueryIdentifier,
|
||||||
type QueryPage,
|
type QueryPage,
|
||||||
getDisplayDate,
|
getDisplayDate,
|
||||||
} from "@kyoo/models";
|
} from "~/models";
|
||||||
import { type ComponentProps, useState } from "react";
|
import { InfiniteFetch } from "../../query/fetch-infinite"
|
||||||
import { createParam } from "solito";
|
import { DefaultLayout } from "../../../packages/ui/src/layout";
|
||||||
import { InfiniteFetch } from "../fetch-infinite";
|
|
||||||
import { DefaultLayout } from "../layout";
|
|
||||||
import { ItemGrid } from "./grid";
|
import { ItemGrid } from "./grid";
|
||||||
import { BrowseSettings } from "./header";
|
import { BrowseSettings } from "./header";
|
||||||
import { ItemList } from "./list";
|
import { ItemList } from "./list";
|
@ -1,23 +1,3 @@
|
|||||||
/*
|
|
||||||
* 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 type { KyooImage, WatchStatusV } from "@kyoo/models";
|
import type { KyooImage, WatchStatusV } from "@kyoo/models";
|
||||||
import {
|
import {
|
||||||
GradientImageBackground,
|
GradientImageBackground,
|
||||||
@ -34,7 +14,7 @@ import {
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Platform, View } from "react-native";
|
import { Platform, View } from "react-native";
|
||||||
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 "../../../packages/ui/src/components/context-menus";
|
||||||
import type { Layout } from "../fetch";
|
import type { Layout } from "../fetch";
|
||||||
import { ItemWatchStatus } from "./grid";
|
import { ItemWatchStatus } from "./grid";
|
||||||
|
|
@ -1,23 +1,3 @@
|
|||||||
/*
|
|
||||||
* 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 Collection from "@material-symbols/svg-400/rounded/collections_bookmark.svg";
|
import Collection from "@material-symbols/svg-400/rounded/collections_bookmark.svg";
|
||||||
import Movie from "@material-symbols/svg-400/rounded/movie.svg";
|
import Movie from "@material-symbols/svg-400/rounded/movie.svg";
|
||||||
import TV from "@material-symbols/svg-400/rounded/tv.svg";
|
import TV from "@material-symbols/svg-400/rounded/tv.svg";
|
Loading…
x
Reference in New Issue
Block a user