mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 12:14:46 -04:00
Rework Pressable to handle ripple on android
This commit is contained in:
parent
a6c645c33f
commit
04eae360a7
@ -19,10 +19,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { ComponentProps, ComponentType, ForwardedRef, forwardRef } from "react";
|
import React, { ComponentProps, ComponentType, ForwardedRef, forwardRef } from "react";
|
||||||
import { Pressable, Platform, PressableProps, ViewStyle } from "react-native";
|
import { Platform, PressableProps, ViewStyle } from "react-native";
|
||||||
import { SvgProps } from "react-native-svg";
|
import { SvgProps } from "react-native-svg";
|
||||||
import { YoshikiStyle } from "yoshiki/dist/type";
|
import { YoshikiStyle } from "yoshiki/dist/type";
|
||||||
import { px, useYoshiki } from "yoshiki/native";
|
import { px, useYoshiki } from "yoshiki/native";
|
||||||
|
import { PressableFeedback } from "./links";
|
||||||
import { ts } from "./utils";
|
import { ts } from "./utils";
|
||||||
|
|
||||||
declare module "react" {
|
declare module "react" {
|
||||||
@ -71,7 +72,7 @@ export const IconButton = forwardRef(function _IconButton<AsProps = PressablePro
|
|||||||
) {
|
) {
|
||||||
const { css } = useYoshiki();
|
const { css } = useYoshiki();
|
||||||
|
|
||||||
const Container = as ?? Pressable;
|
const Container = as ?? PressableFeedback;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container
|
<Container
|
||||||
|
@ -27,6 +27,7 @@ import {
|
|||||||
IconButton,
|
IconButton,
|
||||||
Link,
|
Link,
|
||||||
Poster,
|
Poster,
|
||||||
|
PressableFeedback,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Slider,
|
Slider,
|
||||||
tooltip,
|
tooltip,
|
||||||
@ -34,7 +35,7 @@ import {
|
|||||||
} from "@kyoo/primitives";
|
} from "@kyoo/primitives";
|
||||||
import { Chapter, Font, Track } from "@kyoo/models";
|
import { Chapter, Font, Track } from "@kyoo/models";
|
||||||
import { useAtomValue, useSetAtom, useAtom } from "jotai";
|
import { useAtomValue, useSetAtom, useAtom } from "jotai";
|
||||||
import { Pressable, View, ViewProps } from "react-native";
|
import { View, ViewProps } from "react-native";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { percent, rem, useYoshiki } from "yoshiki/native";
|
import { percent, rem, useYoshiki } from "yoshiki/native";
|
||||||
import { useRouter } from "solito/router";
|
import { useRouter } from "solito/router";
|
||||||
@ -177,7 +178,7 @@ export const Back = ({
|
|||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={ArrowBack}
|
icon={ArrowBack}
|
||||||
{...(href ? { as: Link as any, href: href } : { as: Pressable, onPress: router.back })}
|
{...(href ? { as: Link as any, href: href } : { as: PressableFeedback, onPress: router.back })}
|
||||||
{...tooltip(t("player.back"))}
|
{...tooltip(t("player.back"))}
|
||||||
/>
|
/>
|
||||||
<Skeleton>
|
<Skeleton>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user