Files
streamyfin/components/common/HeaderBackButton.tsx
Gauvain 5f39622ad6
Some checks failed
🤖 Android APK Build / 🏗️ Build Android APK (push) Has been cancelled
🤖 iOS IPA Build / 🏗️ Build iOS IPA (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
fix: bump biome and fix error (#864)
2025-07-21 09:44:24 +02:00

58 lines
1.3 KiB
TypeScript

import { Ionicons } from "@expo/vector-icons";
import { BlurView, type BlurViewProps } from "expo-blur";
import { useRouter } from "expo-router";
import {
Platform,
TouchableOpacity,
type TouchableOpacityProps,
} from "react-native";
interface Props extends BlurViewProps {
background?: "blur" | "transparent";
touchableOpacityProps?: TouchableOpacityProps;
}
export const HeaderBackButton: React.FC<Props> = ({
background = "transparent",
touchableOpacityProps,
...props
}) => {
const router = useRouter();
if (background === "transparent" && Platform.OS !== "android")
return (
<TouchableOpacity
onPress={() => router.back()}
{...touchableOpacityProps}
>
<BlurView
{...props}
intensity={100}
className='overflow-hidden rounded-full p-2'
>
<Ionicons
className='drop-shadow-2xl'
name='arrow-back'
size={24}
color='white'
/>
</BlurView>
</TouchableOpacity>
);
return (
<TouchableOpacity
onPress={() => router.back()}
className=' bg-neutral-800/80 rounded-full p-2'
{...touchableOpacityProps}
>
<Ionicons
className='drop-shadow-2xl'
name='arrow-back'
size={24}
color='white'
/>
</TouchableOpacity>
);
};