mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 14:53:24 +00:00
fix: control touch events on iOS
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { View } from "react-native";
|
||||
import { TouchableWithoutFeedback, View } from "react-native";
|
||||
|
||||
import type { HeaderData } from "./Header";
|
||||
import { usePlayerStore } from "~/stores/player/store";
|
||||
import { BottomControls } from "./BottomControls";
|
||||
import { Header } from "./Header";
|
||||
import { MiddleControls } from "./MiddleControls";
|
||||
@@ -10,11 +11,19 @@ interface ControlsOverlayProps {
|
||||
}
|
||||
|
||||
export const ControlsOverlay = ({ headerData }: ControlsOverlayProps) => {
|
||||
const idle = usePlayerStore((state) => state.interface.isIdle);
|
||||
const setIsIdle = usePlayerStore((state) => state.setIsIdle);
|
||||
|
||||
const handleTouch = () => {
|
||||
setIsIdle(!idle);
|
||||
};
|
||||
return (
|
||||
<View className="absolute left-0 top-0 flex h-full w-full flex-1">
|
||||
<Header data={headerData} />
|
||||
<MiddleControls />
|
||||
<BottomControls />
|
||||
</View>
|
||||
<TouchableWithoutFeedback onPress={handleTouch}>
|
||||
<View className="absolute left-0 top-0 flex h-full w-full flex-1">
|
||||
<Header data={headerData} />
|
||||
<MiddleControls />
|
||||
<BottomControls />
|
||||
</View>
|
||||
</TouchableWithoutFeedback>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user