add play and seek buttons

This commit is contained in:
Jorrin
2024-02-12 18:47:20 +01:00
parent 9dbe9e663f
commit 5bc848ed5f
6 changed files with 105 additions and 12 deletions

View File

@@ -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>
);
};