diff --git a/front/apps/web/src/pages/_app.tsx b/front/apps/web/src/pages/_app.tsx index f9a3c28d..dff31e9a 100755 --- a/front/apps/web/src/pages/_app.tsx +++ b/front/apps/web/src/pages/_app.tsx @@ -29,7 +29,7 @@ import { Hydrate, QueryClientProvider } from "@tanstack/react-query"; import { createQueryClient, fetchQuery, QueryIdentifier, QueryPage } from "@kyoo/models"; import superjson from "superjson"; import Head from "next/head"; -import { ThemeSelector as KThemeSelector } from "@kyoo/primitives"; +import { ThemeSelector as KThemeSelector, WebTooltip } from "@kyoo/primitives"; const ThemeSelector = ({ children }: { children?: ReactNode | ReactNode[] }) => { // TODO: Handle user selected mode (light, dark, auto) @@ -45,27 +45,30 @@ const GlobalCssTheme = () => { const theme = useTheme(); return ( - + *::-webkit-scrollbar-thumb { + background-color: #999; + border-radius: 90px; + } + *:hover::-webkit-scrollbar-thumb { + background-color: rgb(134, 127, 127); + } + `} + + ); }; diff --git a/front/packages/primitives/src/index.ts b/front/packages/primitives/src/index.ts index a8630697..b9c9d3d9 100644 --- a/front/packages/primitives/src/index.ts +++ b/front/packages/primitives/src/index.ts @@ -26,6 +26,7 @@ export * from "./links"; export * from "./avatar"; export * from "./image"; export * from "./skeleton"; +export * from "./tooltip"; import { px } from "yoshiki/native"; diff --git a/front/packages/primitives/src/tooltip.tsx b/front/packages/primitives/src/tooltip.tsx new file mode 100644 index 00000000..74e2fb7e --- /dev/null +++ b/front/packages/primitives/src/tooltip.tsx @@ -0,0 +1,69 @@ +/* + * 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 . + */ + +import { ToastAndroid, PressableProps } from "react-native"; +import { Theme } from "yoshiki/native"; + +export const tooltip = (tooltip: string) => + ({ + dataSet: { tooltip }, + onLongPress: () => { + // TODO handle IOS. + ToastAndroid.show(tooltip, ToastAndroid.SHORT); + }, + } satisfies PressableProps); + +export const WebTooltip = ({ theme }: { theme: Theme }) => { + const background = `${theme.colors.black}CC`; + + return ( + + ); +}; diff --git a/front/packages/primitives/src/types.d.ts b/front/packages/primitives/src/types.d.ts new file mode 100644 index 00000000..c6fb2853 --- /dev/null +++ b/front/packages/primitives/src/types.d.ts @@ -0,0 +1,35 @@ +/* + * 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 . + */ + +import React from "react"; +import "react-native"; + +declare module "react-native" { + interface ViewProps { + dataSet?: Record; + } +} + +declare module "react" { + interface StyleHTMLAttributes extends HTMLAttributes { + jsx?: boolean; + global?: boolean; + } +} diff --git a/front/packages/ui/src/navbar/index.tsx b/front/packages/ui/src/navbar/index.tsx index c054ad68..09b65589 100644 --- a/front/packages/ui/src/navbar/index.tsx +++ b/front/packages/ui/src/navbar/index.tsx @@ -21,13 +21,11 @@ import useTranslation from "next-translate/useTranslation"; import { Library, LibraryP, Page, Paged, QueryIdentifier } from "@kyoo/models"; import { rem, useYoshiki } from "yoshiki/native"; -import { IconButton, Header, Avatar, A, Skeleton, ts } from "@kyoo/primitives"; -import { Text, View } from "react-native"; +import { IconButton, Header, Avatar, A, Skeleton, tooltip, ts } from "@kyoo/primitives"; +import { View } from "react-native"; import { Fetch } from "../fetch"; import { KyooLongLogo } from "./icon"; -const tooltip = (tooltip: string): object => ({}); - export const NavbarTitle = KyooLongLogo; export const Navbar = () => {