Skip to content

Commit e0b61aa

Browse files
committed
fix: remove reanimated and some nav stuff
1 parent 032ca3f commit e0b61aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+52
-1236
lines changed

examples/SampleApp/App.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useEffect } from 'react';
22
import { DevSettings, LogBox, Platform, Text, useColorScheme, View } from 'react-native';
3-
import { createDrawerNavigator } from '@react-navigation/drawer';
43
import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/native';
54
import { createStackNavigator } from '@react-navigation/stack';
65
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -19,7 +18,6 @@ import { ChannelPinnedMessagesScreen } from './src/screens/ChannelPinnedMessages
1918
import { ChatScreen } from './src/screens/ChatScreen';
2019
import { GroupChannelDetailsScreen } from './src/screens/GroupChannelDetailsScreen';
2120
import { LoadingScreen } from './src/screens/LoadingScreen';
22-
import { MenuDrawer } from './src/components/MenuDrawer';
2321
import { NewDirectMessagingScreen } from './src/screens/NewDirectMessagingScreen';
2422
import { NewGroupChannelAddMemberScreen } from './src/screens/NewGroupChannelAddMemberScreen';
2523
import { NewGroupChannelAssignNameScreen } from './src/screens/NewGroupChannelAssignNameScreen';
@@ -37,7 +35,6 @@ if (__DEV__) {
3735
import type { StackNavigatorParamList, UserSelectorParamList } from './src/types';
3836
import { GestureHandlerRootView } from 'react-native-gesture-handler';
3937
import { navigateToChannel, RootNavigationRef } from './src/utils/RootNavigation';
40-
import FastImage from 'react-native-fast-image';
4138

4239
LogBox.ignoreLogs(['Non-serializable values were found in the navigation state']);
4340
console.assert = () => null;
@@ -56,7 +53,6 @@ notifee.onBackgroundEvent(async ({ detail, type }) => {
5653
}
5754
});
5855

59-
const Drawer = createDrawerNavigator();
6056
const Stack = createStackNavigator<StackNavigatorParamList>();
6157
const UserSelectorStack = createStackNavigator<UserSelectorParamList>();
6258
const App = () => {

examples/SampleApp/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
presets: ['module:@react-native/babel-preset'],
3-
plugins: ['react-native-reanimated/plugin'],
3+
plugins: [],
44
};

examples/SampleApp/ios/Podfile.lock

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,130 +1955,6 @@ PODS:
19551955
- RNNotifee/NotifeeCore (= 9.1.8)
19561956
- RNNotifee/NotifeeCore (9.1.8):
19571957
- React-Core
1958-
- RNReanimated (3.18.0):
1959-
- DoubleConversion
1960-
- glog
1961-
- hermes-engine
1962-
- RCT-Folly (= 2024.11.18.00)
1963-
- RCTRequired
1964-
- RCTTypeSafety
1965-
- React-Core
1966-
- React-debug
1967-
- React-Fabric
1968-
- React-featureflags
1969-
- React-graphics
1970-
- React-hermes
1971-
- React-ImageManager
1972-
- React-jsi
1973-
- React-NativeModulesApple
1974-
- React-RCTFabric
1975-
- React-renderercss
1976-
- React-rendererdebug
1977-
- React-utils
1978-
- ReactCodegen
1979-
- ReactCommon/turbomodule/bridging
1980-
- ReactCommon/turbomodule/core
1981-
- RNReanimated/reanimated (= 3.18.0)
1982-
- RNReanimated/worklets (= 3.18.0)
1983-
- Yoga
1984-
- RNReanimated/reanimated (3.18.0):
1985-
- DoubleConversion
1986-
- glog
1987-
- hermes-engine
1988-
- RCT-Folly (= 2024.11.18.00)
1989-
- RCTRequired
1990-
- RCTTypeSafety
1991-
- React-Core
1992-
- React-debug
1993-
- React-Fabric
1994-
- React-featureflags
1995-
- React-graphics
1996-
- React-hermes
1997-
- React-ImageManager
1998-
- React-jsi
1999-
- React-NativeModulesApple
2000-
- React-RCTFabric
2001-
- React-renderercss
2002-
- React-rendererdebug
2003-
- React-utils
2004-
- ReactCodegen
2005-
- ReactCommon/turbomodule/bridging
2006-
- ReactCommon/turbomodule/core
2007-
- RNReanimated/reanimated/apple (= 3.18.0)
2008-
- Yoga
2009-
- RNReanimated/reanimated/apple (3.18.0):
2010-
- DoubleConversion
2011-
- glog
2012-
- hermes-engine
2013-
- RCT-Folly (= 2024.11.18.00)
2014-
- RCTRequired
2015-
- RCTTypeSafety
2016-
- React-Core
2017-
- React-debug
2018-
- React-Fabric
2019-
- React-featureflags
2020-
- React-graphics
2021-
- React-hermes
2022-
- React-ImageManager
2023-
- React-jsi
2024-
- React-NativeModulesApple
2025-
- React-RCTFabric
2026-
- React-renderercss
2027-
- React-rendererdebug
2028-
- React-utils
2029-
- ReactCodegen
2030-
- ReactCommon/turbomodule/bridging
2031-
- ReactCommon/turbomodule/core
2032-
- Yoga
2033-
- RNReanimated/worklets (3.18.0):
2034-
- DoubleConversion
2035-
- glog
2036-
- hermes-engine
2037-
- RCT-Folly (= 2024.11.18.00)
2038-
- RCTRequired
2039-
- RCTTypeSafety
2040-
- React-Core
2041-
- React-debug
2042-
- React-Fabric
2043-
- React-featureflags
2044-
- React-graphics
2045-
- React-hermes
2046-
- React-ImageManager
2047-
- React-jsi
2048-
- React-NativeModulesApple
2049-
- React-RCTFabric
2050-
- React-renderercss
2051-
- React-rendererdebug
2052-
- React-utils
2053-
- ReactCodegen
2054-
- ReactCommon/turbomodule/bridging
2055-
- ReactCommon/turbomodule/core
2056-
- RNReanimated/worklets/apple (= 3.18.0)
2057-
- Yoga
2058-
- RNReanimated/worklets/apple (3.18.0):
2059-
- DoubleConversion
2060-
- glog
2061-
- hermes-engine
2062-
- RCT-Folly (= 2024.11.18.00)
2063-
- RCTRequired
2064-
- RCTTypeSafety
2065-
- React-Core
2066-
- React-debug
2067-
- React-Fabric
2068-
- React-featureflags
2069-
- React-graphics
2070-
- React-hermes
2071-
- React-ImageManager
2072-
- React-jsi
2073-
- React-NativeModulesApple
2074-
- React-RCTFabric
2075-
- React-renderercss
2076-
- React-rendererdebug
2077-
- React-utils
2078-
- ReactCodegen
2079-
- ReactCommon/turbomodule/bridging
2080-
- ReactCommon/turbomodule/core
2081-
- Yoga
20821958
- RNScreens (4.11.1):
20831959
- DoubleConversion
20841960
- glog
@@ -2216,7 +2092,6 @@ DEPENDENCIES:
22162092
- "RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`)"
22172093
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
22182094
- "RNNotifee (from `../node_modules/@notifee/react-native`)"
2219-
- RNReanimated (from `../node_modules/react-native-reanimated`)
22202095
- RNScreens (from `../node_modules/react-native-screens`)
22212096
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
22222097

@@ -2397,8 +2272,6 @@ EXTERNAL SOURCES:
23972272
:path: "../node_modules/react-native-gesture-handler"
23982273
RNNotifee:
23992274
:path: "../node_modules/@notifee/react-native"
2400-
RNReanimated:
2401-
:path: "../node_modules/react-native-reanimated"
24022275
RNScreens:
24032276
:path: "../node_modules/react-native-screens"
24042277
Yoga:
@@ -2499,7 +2372,6 @@ SPEC CHECKSUMS:
24992372
RNFBMessaging: 6586f18ab3411aeb3349088c19fe54283d39e529
25002373
RNGestureHandler: 2fa49aef8b58d35bcc61abe06ffecc4bcc5268a4
25012374
RNNotifee: 4a6ee5c7deaf00e005050052d73ee6315dff7ec9
2502-
RNReanimated: 2b314b18e28adf1b300f606eb0f205a1a6a643e1
25032375
RNScreens: d9d5d8a2a484bb4446968bfa00db991f1117db44
25042376
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
25052377
Yoga: b2eaabf17044cd4273a661b14eb83f9fd2c90491

examples/SampleApp/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@
3030
"@react-native-firebase/app": "22.2.1",
3131
"@react-native-firebase/messaging": "22.2.1",
3232
"@react-navigation/bottom-tabs": "7.3.14",
33-
"@react-navigation/drawer": "7.4.1",
3433
"@react-navigation/native": "^7.1.10",
3534
"@react-navigation/stack": "^7.3.3",
3635
"react": "19.0.0",
3736
"react-native": "^0.79.3",
3837
"react-native-gesture-handler": "^2.26.0",
39-
"react-native-reanimated": "^3.18.0",
4038
"react-native-safe-area-context": "^5.4.1",
4139
"react-native-screens": "^4.11.1"
4240
},

examples/SampleApp/src/components/BottomSheetOverlay.tsx

Lines changed: 2 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,6 @@ import {
66
State,
77
TapGestureHandler,
88
} from 'react-native-gesture-handler';
9-
import Animated, {
10-
cancelAnimation,
11-
Easing,
12-
Extrapolate,
13-
interpolate,
14-
runOnJS,
15-
useAnimatedGestureHandler,
16-
useAnimatedStyle,
17-
useSharedValue,
18-
withDecay,
19-
withSpring,
20-
withTiming,
21-
} from 'react-native-reanimated';
229

2310
import { AddMemberBottomSheet } from './AddMemberBottomSheet';
2411
import { ConfirmationBottomSheet } from './ConfirmationBottomSheet';
@@ -39,7 +26,7 @@ const styles = StyleSheet.create({
3926
});
4027

4128
export type BottomSheetOverlayProps = {
42-
overlayOpacity: Animated.SharedValue<number>;
29+
overlayOpacity: number;
4330
visible: boolean;
4431
};
4532

@@ -50,149 +37,15 @@ export const BottomSheetOverlay = (props: BottomSheetOverlayProps) => {
5037

5138
const { reset } = useBottomSheetOverlayContext();
5239

53-
const offsetY = useSharedValue(0);
54-
const showScreen = useSharedValue(0);
55-
const translateY = useSharedValue(0);
56-
const viewHeight = useSharedValue(0);
57-
58-
const fadeScreen = (show: boolean) => {
59-
'worklet';
60-
if (show) {
61-
offsetY.value = 0;
62-
translateY.value = 0;
63-
}
64-
showScreen.value = show
65-
? withSpring(1, {
66-
damping: 600,
67-
mass: 0.5,
68-
restDisplacementThreshold: 0.01,
69-
restSpeedThreshold: 0.01,
70-
stiffness: 200,
71-
velocity: 32,
72-
})
73-
: withTiming(
74-
0,
75-
{
76-
duration: 150,
77-
easing: Easing.out(Easing.ease),
78-
},
79-
() => {
80-
if (!show) {
81-
runOnJS(reset)();
82-
}
83-
},
84-
);
85-
};
86-
8740
useEffect(() => {
8841
if (visible) {
8942
Keyboard.dismiss();
9043
}
91-
fadeScreen(!!visible);
92-
// eslint-disable-next-line react-hooks/exhaustive-deps
9344
}, [visible]);
9445

95-
const onPan = useAnimatedGestureHandler<PanGestureHandlerGestureEvent>({
96-
onActive: (evt) => {
97-
translateY.value = offsetY.value + evt.translationY;
98-
overlayOpacity.value = interpolate(
99-
translateY.value,
100-
[0, viewHeight.value / 2],
101-
[1, 0.75],
102-
Extrapolate.CLAMP,
103-
);
104-
},
105-
onFinish: (evt) => {
106-
const finalYPosition = evt.translationY + evt.velocityY * 0.1;
107-
108-
if (finalYPosition > viewHeight.value / 2 && translateY.value > 0) {
109-
cancelAnimation(translateY);
110-
overlayOpacity.value = withTiming(
111-
0,
112-
{
113-
duration: 200,
114-
easing: Easing.out(Easing.ease),
115-
},
116-
() => {
117-
runOnJS(setOverlay)('none');
118-
},
119-
);
120-
translateY.value =
121-
evt.velocityY > 1000
122-
? withDecay({
123-
velocity: evt.velocityY,
124-
})
125-
: withTiming(100, {
126-
duration: 200,
127-
easing: Easing.out(Easing.ease),
128-
});
129-
} else {
130-
translateY.value = withTiming(0);
131-
overlayOpacity.value = withTiming(1);
132-
}
133-
},
134-
onStart: () => {
135-
cancelAnimation(translateY);
136-
offsetY.value = translateY.value;
137-
},
138-
});
139-
140-
const panStyle = useAnimatedStyle(() => ({
141-
transform: [
142-
{
143-
translateY: translateY.value > 0 ? translateY.value : 0,
144-
},
145-
],
146-
}));
147-
148-
const showScreenStyle = useAnimatedStyle(() => ({
149-
transform: [
150-
{
151-
translateY: interpolate(showScreen.value, [0, 1], [viewHeight.value / 2, 0]),
152-
},
153-
],
154-
}));
155-
15646
if (!visible) {
15747
return null;
15848
}
15949

160-
return (
161-
<Animated.View pointerEvents={visible ? 'auto' : 'none'} style={StyleSheet.absoluteFill}>
162-
<PanGestureHandler enabled={visible} maxPointers={1} minDist={10} onGestureEvent={onPan}>
163-
<Animated.View style={StyleSheet.absoluteFillObject}>
164-
<TapGestureHandler
165-
maxDist={32}
166-
onHandlerStateChange={({ nativeEvent: { state } }) => {
167-
if (state === State.END) {
168-
setOverlay('none');
169-
}
170-
}}
171-
>
172-
<Animated.View style={[styles.animatedContainer, panStyle]}>
173-
<TapGestureHandler>
174-
<Animated.View
175-
onLayout={({
176-
nativeEvent: {
177-
layout: { height },
178-
},
179-
}) => {
180-
viewHeight.value = height;
181-
}}
182-
style={[
183-
styles.container,
184-
showScreenStyle,
185-
overlay === 'addMembers' ? styles.addMembers : undefined,
186-
]}
187-
>
188-
{overlay === 'addMembers' && <AddMemberBottomSheet />}
189-
{overlay === 'confirmation' && <ConfirmationBottomSheet />}
190-
</Animated.View>
191-
</TapGestureHandler>
192-
</Animated.View>
193-
</TapGestureHandler>
194-
</Animated.View>
195-
</PanGestureHandler>
196-
</Animated.View>
197-
);
50+
return null;
19851
};

0 commit comments

Comments
 (0)