This commit is contained in:
Maxym Hyba
2025-10-29 17:46:21 +02:00
committed by GitHub
parent f15a949ef8
commit faa389e060
2 changed files with 7 additions and 11 deletions
@@ -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)
}
+6 -6
View File
@@ -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()