From 0986c1305f0e22b5d4e3dda20568a9e77c932387 Mon Sep 17 00:00:00 2001 From: "Nikita.Zheleznov" Date: Wed, 6 Jul 2022 15:29:20 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=92=85=20update=20opacity=20screen?= =?UTF-8?q?=20#44?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- screens/Profile/ProfileScreen.tsx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/screens/Profile/ProfileScreen.tsx b/screens/Profile/ProfileScreen.tsx index b22d6e39..38acade7 100644 --- a/screens/Profile/ProfileScreen.tsx +++ b/screens/Profile/ProfileScreen.tsx @@ -34,6 +34,7 @@ import { ChangeLanguage, ChangeWallet, } from "./components/organisms"; +import { useDimensions } from "@react-native-community/hooks"; type Props = NativeStackScreenProps; @@ -50,9 +51,16 @@ export default observer(function MainScreen({ navigation }) { // ------- BottomSheet ---------- - const currentPosition = useSharedValue(0); + const { screen } = useDimensions(); + + const currentPosition = useSharedValue(screen.height); const animStyle = useAnimatedStyle(() => { - const opacity = interpolate(currentPosition.value, [0, 350], [0, 0.5]); + const opacity = interpolate( + currentPosition.value, + [0, screen.height], + [0, 1], + Extrapolation.EXTEND + ); return { flex: 1, opacity, @@ -69,8 +77,7 @@ export default observer(function MainScreen({ navigation }) { const navToPrivacy = useCallback(() => {}, []); const navToTerms = useCallback(() => {}, []); - const disconnectAndRemove = useCallback(() => { - }, []); + const disconnectAndRemove = useCallback(() => {}, []); const openAddWatchaccount = useCallback(() => {}, []); const openSecurity = useCallback( @@ -146,7 +153,6 @@ export default observer(function MainScreen({ navigation }) { zIndex: 1000, top: 70, width: "100%", - // backgroundColor: "red", }; }); @@ -156,7 +162,7 @@ export default observer(function MainScreen({ navigation }) { - +
(function MainScreen({ navigation }) { style={styles.agreement} /> - + Settings