mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 15:03:26 +00:00
30 lines
687 B
TypeScript
30 lines
687 B
TypeScript
import { useRouter } from "expo-router";
|
|
import { Ionicons } from "@expo/vector-icons";
|
|
|
|
import { usePlayerStore } from "~/stores/player/store";
|
|
|
|
export const BackButton = ({
|
|
className,
|
|
}: Partial<React.ComponentProps<typeof Ionicons>>) => {
|
|
const unlockOrientation = usePlayerStore((state) => state.unlockOrientation);
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<Ionicons
|
|
name="arrow-back"
|
|
onPress={() => {
|
|
unlockOrientation()
|
|
.then(() => {
|
|
return router.back();
|
|
})
|
|
.catch(() => {
|
|
return router.back();
|
|
});
|
|
}}
|
|
size={36}
|
|
color="white"
|
|
className={className}
|
|
/>
|
|
);
|
|
};
|