Skip to content

Commit

Permalink
fix: 💅 update opacity screen
Browse files Browse the repository at this point in the history
  • Loading branch information
zheleznov163 committed Jul 6, 2022
1 parent 52c1fa5 commit 0986c13
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions screens/Profile/ProfileScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
ChangeLanguage,
ChangeWallet,
} from "./components/organisms";
import { useDimensions } from "@react-native-community/hooks";

type Props = NativeStackScreenProps<RootStackParamList, "Profile">;

Expand All @@ -50,9 +51,16 @@ export default observer<Props>(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,
Expand All @@ -69,8 +77,7 @@ export default observer<Props>(function MainScreen({ navigation }) {

const navToPrivacy = useCallback(() => {}, []);
const navToTerms = useCallback(() => {}, []);
const disconnectAndRemove = useCallback(() => {
}, []);
const disconnectAndRemove = useCallback(() => {}, []);

const openAddWatchaccount = useCallback(() => {}, []);
const openSecurity = useCallback(
Expand Down Expand Up @@ -146,7 +153,6 @@ export default observer<Props>(function MainScreen({ navigation }) {
zIndex: 1000,
top: 70,
width: "100%",
// backgroundColor: "red",
};
});

Expand All @@ -156,7 +162,7 @@ export default observer<Props>(function MainScreen({ navigation }) {

<ThemedGradient style={styles.container} invert>
<SafeAreaView style={styles.container}>
<Animated.View style={animStyle}>
<Animated.View style={[{ opacity: 1 }, animStyle]}>
<Header
onPressClose={goBack}
style={styles.header}
Expand Down Expand Up @@ -204,7 +210,7 @@ export default observer<Props>(function MainScreen({ navigation }) {
style={styles.agreement}
/>

<View style={{opacity: 0.2}} pointerEvents={"none"}>
<View style={{ opacity: 0.2 }} pointerEvents={"none"}>
<Title style={styles.title}>Settings</Title>

<View style={styles.section}>
Expand Down

0 comments on commit 0986c13

Please sign in to comment.