mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
Improve layout, add current time and duration
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { TouchableOpacity } from "react-native";
|
||||
import React from "react";
|
||||
import { TouchableOpacity } from "react-native";
|
||||
import { TouchableWithoutFeedback } from "react-native-gesture-handler";
|
||||
|
||||
import { usePlayerStore } from "~/stores/player/store";
|
||||
|
||||
@@ -9,10 +10,14 @@ interface ControlsProps extends React.ComponentProps<typeof TouchableOpacity> {
|
||||
|
||||
export const Controls = ({ children, className }: ControlsProps) => {
|
||||
const idle = usePlayerStore((state) => state.interface.isIdle);
|
||||
const setIsIdle = usePlayerStore((state) => state.setIsIdle);
|
||||
|
||||
return (
|
||||
<TouchableOpacity className={className}>
|
||||
<TouchableWithoutFeedback
|
||||
className={className}
|
||||
onPress={() => setIsIdle(false)}
|
||||
>
|
||||
{!idle && children}
|
||||
</TouchableOpacity>
|
||||
</TouchableWithoutFeedback>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user