From 3c2d73909b1cf4716764ccb3e86ce77832d2e37d Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 29 Apr 2024 16:11:59 +0100 Subject: [PATCH] Remove layout animation from search (#3751) --- src/view/screens/Search/Search.tsx | 59 ++++++++++-------------------- 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index 9355c2d6..1524c244 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -7,13 +7,6 @@ import { TextInput, View, } from 'react-native' -import Animated, { - FadeIn, - FadeOut, - LinearTransition, - useAnimatedStyle, - withSpring, -} from 'react-native-reanimated' import {AppBskyActorDefs, AppBskyFeedDefs, moderateProfile} from '@atproto/api' import { FontAwesomeIcon, @@ -63,7 +56,6 @@ import { } from '#/view/shell/desktop/Search' import {ProfileCardFeedLoadingPlaceholder} from 'view/com/util/LoadingPlaceholder' import {atoms as a} from '#/alf' -const AnimatedPressable = Animated.createAnimatedComponent(Pressable) function Loader() { const pal = usePalette('default') @@ -624,14 +616,6 @@ export function SearchScreen( ) } - const showClearButton = showAutocomplete && searchText.length > 0 - const clearButtonStyle = useAnimatedStyle(() => ({ - opacity: withSpring(showClearButton ? 1 : 0, { - overshootClamping: true, - duration: 50, - }), - })) - return ( )} - - - - - + {showAutocomplete && searchText.length > 0 && ( + + + + )} + {showAutocomplete && ( - Cancel - + )}