Skip to content

Commit 6770436

Browse files
author
tfomkin
committed
fix: upsert folder sheet crash fix, reanimated version fix, type errors fix
1 parent 0d97195 commit 6770436

6 files changed

Lines changed: 135 additions & 240 deletions

File tree

apps/mobile/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module.exports = function (api) {
1212
'nativewind/babel',
1313
],
1414
plugins: [
15-
'react-native-reanimated/plugin',
1615
[
1716
'module-resolver',
1817
{
@@ -23,6 +22,7 @@ module.exports = function (api) {
2322
},
2423
},
2524
],
25+
'react-native-worklets/plugin',
2626
],
2727
};
2828
};

apps/mobile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"react-native-keyboard-controller": "1.18.5",
7474
"react-native-mmkv": "^3.2.0",
7575
"react-native-modal": "^14.0.0-rc.1",
76-
"react-native-reanimated": "^4.1.6",
76+
"react-native-reanimated": "~4.1.1",
7777
"react-native-safe-area-context": "~5.6.0",
7878
"react-native-screens": "~4.16.0",
7979
"react-native-svg": "15.12.1",

libs/mobile/shared/features/use-swipe-to-close/src/use-swipe-to-close.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { Gesture } from 'react-native-gesture-handler';
2-
import {
3-
Extrapolation,
4-
interpolate,
5-
runOnJS,
6-
useAnimatedStyle,
7-
useSharedValue,
8-
withTiming,
9-
} from 'react-native-reanimated';
2+
import { Extrapolation, interpolate, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
3+
import { scheduleOnRN } from 'react-native-worklets';
104
import { screenHeight } from '@open-webui-react-native/mobile/shared/ui/styles';
115

126
interface UseSwipeToCloseParams {
@@ -55,7 +49,7 @@ export const useSwipeToClose = ({ onReachDistance, scrollDirection = 'all' }: Us
5549
})
5650
.onEnd(() => {
5751
if (Math.abs(translateY.value) > 125) {
58-
runOnJS(onReachDistance)();
52+
scheduleOnRN(onReachDistance);
5953
translateY.value = withTiming(0, { duration: 750 });
6054
} else {
6155
translateY.value = withTiming(0, { duration: 350 });

libs/mobile/shared/ui/ui-kit/src/floated-label-input/component.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ReactElement, Ref, useState, useEffect } from 'react';
2-
import { NativeSyntheticEvent, Platform, TextInput, TextInputFocusEventData, TextInputProps } from 'react-native';
2+
import { Platform, TextInput, TextInputProps } from 'react-native';
33
import { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
44
import { cn } from '@open-webui-react-native/mobile/shared/ui/styles';
55
import { IconButton } from '../icon-button';
@@ -55,7 +55,6 @@ export const FloatedLabelInput = ({
5555
top: labelTop.value,
5656
left: labelLeft.value,
5757
transform: [{ scale: labelScale.value }],
58-
transformOrigin: 'left',
5958
}));
6059

6160
const accessoryRightComponent = isPassword ? (
@@ -64,12 +63,12 @@ export const FloatedLabelInput = ({
6463
accessoryRight
6564
);
6665

67-
const handleFocus = (e: NativeSyntheticEvent<TextInputFocusEventData>): void => {
66+
const handleFocus: TextInputProps['onFocus'] = (e): void => {
6867
setIsFocused(true);
6968
onFocus?.(e);
7069
};
7170

72-
const handleBlur = (e: NativeSyntheticEvent<TextInputFocusEventData>): void => {
71+
const handleBlur: TextInputProps['onBlur'] = (e): void => {
7372
setIsFocused(false);
7473
onBlur?.(e);
7574
};
@@ -85,7 +84,7 @@ export const FloatedLabelInput = ({
8584
{label && (
8685
<AnimatedView
8786
className={cn('absolute z-10 pl-12')}
88-
style={labelAnimatedStyle}
87+
style={[labelAnimatedStyle, { transformOrigin: 'left' }]}
8988
pointerEvents='none'>
9089
<AppText
9190
pointerEvents='none'

0 commit comments

Comments
 (0)