tangled
alpha
login
or
join now
bas.sh
/
witchsky.app
forked from
jollywhoppers.com/witchsky.app
0
fork
atom
Bluesky app fork with some witchin' additions 💫
0
fork
atom
overview
issues
pulls
pipelines
rm clamp (#9271)
authored by
Maxym Hyba
and committed by
GitHub
4 months ago
faa389e0
f15a949e
+7
-11
2 changed files
expand all
collapse all
unified
split
src
screens
VideoFeed
components
Scrubber.tsx
view
com
util
MainScrollProvider.tsx
+1
-5
src/screens/VideoFeed/components/Scrubber.tsx
···
6
6
type NativeGesture,
7
7
} from 'react-native-gesture-handler'
8
8
import Animated, {
9
9
+
clamp,
9
10
interpolate,
10
11
runOnJS,
11
12
runOnUI,
···
258
259
259
260
return null
260
261
}
261
261
-
262
262
-
function clamp(num: number, min: number, max: number) {
263
263
-
'worklet'
264
264
-
return Math.min(Math.max(num, min), max)
265
265
-
}
+6
-6
src/view/com/util/MainScrollProvider.tsx
···
1
1
import React, {useCallback, useEffect} from 'react'
2
2
import {type NativeScrollEvent} from 'react-native'
3
3
-
import {interpolate, useSharedValue, withSpring} from 'react-native-reanimated'
3
3
+
import {
4
4
+
clamp,
5
5
+
interpolate,
6
6
+
useSharedValue,
7
7
+
withSpring,
8
8
+
} from 'react-native-reanimated'
4
9
import EventEmitter from 'eventemitter3'
5
10
6
11
import {ScrollProvider} from '#/lib/ScrollContext'
···
9
14
import {useShellLayout} from '#/state/shell/shell-layout'
10
15
11
16
const WEB_HIDE_SHELL_THRESHOLD = 200
12
12
-
13
13
-
function clamp(num: number, min: number, max: number) {
14
14
-
'worklet'
15
15
-
return Math.min(Math.max(num, min), max)
16
16
-
}
17
17
18
18
export function MainScrollProvider({children}: {children: React.ReactNode}) {
19
19
const {headerHeight} = useShellLayout()