diff --git a/src/components/ActionSheetAwareScrollView/index.ios.tsx b/src/components/ActionSheetAwareScrollView/index.ios.tsx index 9c465b966daf6..8f2dde9646f5d 100644 --- a/src/components/ActionSheetAwareScrollView/index.ios.tsx +++ b/src/components/ActionSheetAwareScrollView/index.ios.tsx @@ -4,9 +4,9 @@ import React, {forwardRef, useCallback} from 'react'; import type {ScrollView, ScrollViewProps} from 'react-native'; import Reanimated, {useAnimatedRef, useScrollViewOffset} from 'react-native-reanimated'; import {Actions, ActionSheetAwareScrollViewContext, ActionSheetAwareScrollViewProvider} from './ActionSheetAwareScrollViewContext'; -import ActionSheetKeyboardSpace from './ActionSheetKeyboardSpace'; +import useActionSheetKeyboardSpace from './useActionSheetKeyboardSpace'; -const ActionSheetAwareScrollView = forwardRef>((props, ref) => { +const ActionSheetAwareScrollView = forwardRef>(({style, children, ...rest}, ref) => { const scrollViewAnimatedRef = useAnimatedRef(); const position = useScrollViewOffset(scrollViewAnimatedRef); @@ -24,13 +24,16 @@ const ActionSheetAwareScrollView = forwardRef - {props.children} + {children} ); }); diff --git a/src/components/ActionSheetAwareScrollView/ActionSheetKeyboardSpace.tsx b/src/components/ActionSheetAwareScrollView/useActionSheetKeyboardSpace.tsx similarity index 93% rename from src/components/ActionSheetAwareScrollView/ActionSheetKeyboardSpace.tsx rename to src/components/ActionSheetAwareScrollView/useActionSheetKeyboardSpace.tsx index cf96a0823b0f5..cb97ffec117ab 100644 --- a/src/components/ActionSheetAwareScrollView/ActionSheetKeyboardSpace.tsx +++ b/src/components/ActionSheetAwareScrollView/useActionSheetKeyboardSpace.tsx @@ -1,10 +1,9 @@ -import React, {useContext, useEffect} from 'react'; +import {useContext, useEffect} from 'react'; import type {ViewProps} from 'react-native'; import {useKeyboardHandler} from 'react-native-keyboard-controller'; -import Reanimated, {useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, withSequence, withSpring, withTiming} from 'react-native-reanimated'; +import {useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue, withSequence, withSpring, withTiming} from 'react-native-reanimated'; import type {SharedValue} from 'react-native-reanimated'; import useSafeAreaPaddings from '@hooks/useSafeAreaPaddings'; -import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import {Actions, ActionSheetAwareScrollViewContext, States} from './ActionSheetAwareScrollViewContext'; @@ -65,8 +64,7 @@ type ActionSheetKeyboardSpaceProps = ViewProps & { position?: SharedValue; }; -function ActionSheetKeyboardSpace(props: ActionSheetKeyboardSpaceProps) { - const styles = useThemeStyles(); +function useActionSheetKeyboardSpace(props: ActionSheetKeyboardSpaceProps) { const { unmodifiedPaddings: {top: paddingTop = 0, bottom: paddingBottom = 0}, } = useSafeAreaPaddings(); @@ -253,15 +251,7 @@ function ActionSheetKeyboardSpace(props: ActionSheetKeyboardSpaceProps) { paddingTop: translateY.get(), })); - return ( - - ); + return {animatedStyle}; } -ActionSheetKeyboardSpace.displayName = 'ActionSheetKeyboardSpace'; - -export default ActionSheetKeyboardSpace; +export default useActionSheetKeyboardSpace;