Move /platform/detection vars into /env (#9707)
* Add platform vars to env * Replace /platform/detection with /env
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, {useContext} from 'react'
|
||||
import {type SharedValue} from 'react-native-reanimated'
|
||||
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
|
||||
export const PagerHeaderContext = React.createContext<{
|
||||
scrollY: SharedValue<number>
|
||||
@@ -37,7 +37,7 @@ export function PagerHeaderProvider({
|
||||
|
||||
export function usePagerHeaderContext() {
|
||||
const ctx = useContext(PagerHeaderContext)
|
||||
if (isNative) {
|
||||
if (IS_NATIVE) {
|
||||
if (!ctx) {
|
||||
throw new Error(
|
||||
'usePagerHeaderContext must be used within a HeaderProvider',
|
||||
|
||||
@@ -18,13 +18,13 @@ import Animated, {
|
||||
|
||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
import {ScrollProvider} from '#/lib/ScrollContext'
|
||||
import {isIOS} from '#/platform/detection'
|
||||
import {
|
||||
Pager,
|
||||
type PagerRef,
|
||||
type RenderTabBarFnProps,
|
||||
} from '#/view/com/pager/Pager'
|
||||
import {useTheme} from '#/alf'
|
||||
import {IS_IOS} from '#/env'
|
||||
import {type ListMethods} from '../util/List'
|
||||
import {PagerHeaderProvider} from './PagerHeaderContext'
|
||||
import {TabBar} from './TabBar'
|
||||
@@ -273,11 +273,11 @@ let PagerTabBar = ({
|
||||
const headerRef = useRef(null)
|
||||
return (
|
||||
<Animated.View
|
||||
pointerEvents={isIOS ? 'auto' : 'box-none'}
|
||||
pointerEvents={IS_IOS ? 'auto' : 'box-none'}
|
||||
style={[styles.tabBarMobile, headerTransform, t.atoms.bg]}>
|
||||
<View
|
||||
ref={headerRef}
|
||||
pointerEvents={isIOS ? 'auto' : 'box-none'}
|
||||
pointerEvents={IS_IOS ? 'auto' : 'box-none'}
|
||||
collapsable={false}>
|
||||
{renderHeader?.({setMinimumHeight: setMinimumHeaderHeight})}
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user