import { useRef } from "react"; import { Platform, View } from "react-native"; import * as Haptics from "expo-haptics"; import { Tabs } from "expo-router"; import * as ScreenOrientation from "expo-screen-orientation"; import { defaultTheme } from "@movie-web/tailwind-config/themes"; import { MovieWebSvg } from "~/components/Icon"; import SvgTabBarIcon from "~/components/SvgTabBarIcon"; import TabBarIcon from "~/components/TabBarIcon"; import { cn } from "~/lib/utils"; import SearchTabContext from "../../components/ui/SearchTabContext"; export default function TabLayout() { // eslint-disable-next-line @typescript-eslint/no-empty-function const focusSearchInputRef = useRef(() => {}); return ( ({ tabPress: () => { void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); switch (route.name) { case "search": focusSearchInputRef.current(); break; } }, focus: () => { void ScreenOrientation.lockAsync( ScreenOrientation.OrientationLock.PORTRAIT_UP, ); }, })} screenOptions={{ headerShown: false, tabBarActiveTintColor: defaultTheme.extend.colors.tabBar.active, tabBarStyle: { backgroundColor: defaultTheme.extend.colors.tabBar.background, borderTopColor: "transparent", borderTopRightRadius: 20, borderTopLeftRadius: 20, paddingBottom: Platform.select({ ios: 100 }), height: 80, }, tabBarItemStyle: { paddingVertical: 18, height: 82, }, tabBarLabelStyle: [ { marginTop: 2, }, ], }} > ( ), }} /> ( ), }} /> ( ), }} /> ( ), }} /> ( ), }} /> ); }