rm clamp (#9271)
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
|||||||
type NativeGesture,
|
type NativeGesture,
|
||||||
} from 'react-native-gesture-handler'
|
} from 'react-native-gesture-handler'
|
||||||
import Animated, {
|
import Animated, {
|
||||||
|
clamp,
|
||||||
interpolate,
|
interpolate,
|
||||||
runOnJS,
|
runOnJS,
|
||||||
runOnUI,
|
runOnUI,
|
||||||
@@ -258,8 +259,3 @@ function PlayerListener({
|
|||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
function clamp(num: number, min: number, max: number) {
|
|
||||||
'worklet'
|
|
||||||
return Math.min(Math.max(num, min), max)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
import React, {useCallback, useEffect} from 'react'
|
import React, {useCallback, useEffect} from 'react'
|
||||||
import {type NativeScrollEvent} from 'react-native'
|
import {type NativeScrollEvent} from 'react-native'
|
||||||
import {interpolate, useSharedValue, withSpring} from 'react-native-reanimated'
|
import {
|
||||||
|
clamp,
|
||||||
|
interpolate,
|
||||||
|
useSharedValue,
|
||||||
|
withSpring,
|
||||||
|
} from 'react-native-reanimated'
|
||||||
import EventEmitter from 'eventemitter3'
|
import EventEmitter from 'eventemitter3'
|
||||||
|
|
||||||
import {ScrollProvider} from '#/lib/ScrollContext'
|
import {ScrollProvider} from '#/lib/ScrollContext'
|
||||||
@@ -10,11 +15,6 @@ import {useShellLayout} from '#/state/shell/shell-layout'
|
|||||||
|
|
||||||
const WEB_HIDE_SHELL_THRESHOLD = 200
|
const WEB_HIDE_SHELL_THRESHOLD = 200
|
||||||
|
|
||||||
function clamp(num: number, min: number, max: number) {
|
|
||||||
'worklet'
|
|
||||||
return Math.min(Math.max(num, min), max)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function MainScrollProvider({children}: {children: React.ReactNode}) {
|
export function MainScrollProvider({children}: {children: React.ReactNode}) {
|
||||||
const {headerHeight} = useShellLayout()
|
const {headerHeight} = useShellLayout()
|
||||||
const {headerMode} = useMinimalShellMode()
|
const {headerMode} = useMinimalShellMode()
|
||||||
|
|||||||
Reference in New Issue
Block a user