Improve layout, add current time and duration

This commit is contained in:
Jorrin
2024-02-13 21:13:48 +01:00
parent 0a98e86de1
commit 378b16b3e4
7 changed files with 118 additions and 49 deletions

View File

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