mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
add play and seek buttons
This commit is contained in:
@@ -1,13 +1,24 @@
|
||||
import { View } from "react-native";
|
||||
import React from "react";
|
||||
import { TouchableOpacity } from "react-native";
|
||||
|
||||
import { usePlayerStore } from "~/stores/player/store";
|
||||
|
||||
interface ControlsProps {
|
||||
interface ControlsProps extends React.ComponentProps<typeof TouchableOpacity> {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export const Controls = ({ children }: ControlsProps) => {
|
||||
export const Controls = ({ children, className }: ControlsProps) => {
|
||||
const idle = usePlayerStore((state) => state.interface.isIdle);
|
||||
const setIsIdle = usePlayerStore((state) => state.setIsIdle);
|
||||
|
||||
return <View className="flex-1 items-center">{!idle && children}</View>;
|
||||
return (
|
||||
<TouchableOpacity
|
||||
onPress={() => {
|
||||
setIsIdle(false);
|
||||
}}
|
||||
className={className}
|
||||
>
|
||||
{!idle && children}
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user