mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 09:01:19 +00:00
19 lines
521 B
TypeScript
19 lines
521 B
TypeScript
|
|
import { BottomTabBarButtonProps } from "@react-navigation/bottom-tabs"
|
||
|
|
import { PlatformPressable } from "@react-navigation/elements"
|
||
|
|
import * as Haptics from "expo-haptics"
|
||
|
|
|
||
|
|
export function HapticTab(props: BottomTabBarButtonProps) {
|
||
|
|
return (
|
||
|
|
<PlatformPressable
|
||
|
|
{...props}
|
||
|
|
onPressIn={(ev) => {
|
||
|
|
if (process.env.EXPO_OS === "ios") {
|
||
|
|
// Add a soft haptic feedback when pressing down on the tabs.
|
||
|
|
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)
|
||
|
|
}
|
||
|
|
props.onPressIn?.(ev)
|
||
|
|
}}
|
||
|
|
/>
|
||
|
|
)
|
||
|
|
}
|