mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -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 { Pressable, Platform, PressableProps, ViewStyle } from "react-native";
|
||||
import { Platform, PressableProps, ViewStyle } from "react-native";
|
||||
import { SvgProps } from "react-native-svg";
|
||||
import { YoshikiStyle } from "yoshiki/dist/type";
|
||||
import { px, useYoshiki } from "yoshiki/native";
|
||||
import { PressableFeedback } from "./links";
|
||||
import { ts } from "./utils";
|
||||
|
||||
declare module "react" {
|
||||
@ -71,7 +72,7 @@ export const IconButton = forwardRef(function _IconButton<AsProps = PressablePro
|
||||
) {
|
||||
const { css } = useYoshiki();
|
||||
|
||||
const Container = as ?? Pressable;
|
||||
const Container = as ?? PressableFeedback;
|
||||
|
||||
return (
|
||||
<Container
|
||||
|
@ -27,6 +27,7 @@ import {
|
||||
IconButton,
|
||||
Link,
|
||||
Poster,
|
||||
PressableFeedback,
|
||||
Skeleton,
|
||||
Slider,
|
||||
tooltip,
|
||||
@ -34,7 +35,7 @@ import {
|
||||
} from "@kyoo/primitives";
|
||||
import { Chapter, Font, Track } from "@kyoo/models";
|
||||
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 { percent, rem, useYoshiki } from "yoshiki/native";
|
||||
import { useRouter } from "solito/router";
|
||||
@ -177,7 +178,7 @@ export const Back = ({
|
||||
>
|
||||
<IconButton
|
||||
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"))}
|
||||
/>
|
||||
<Skeleton>
|
||||
|
Loading…
x
Reference in New Issue
Block a user