From 57b4b60809fad6eafcaf23ca8050db9418568b4c Mon Sep 17 00:00:00 2001 From: analuizaff Date: Thu, 8 Apr 2021 17:44:39 -0300 Subject: [PATCH] fixing float button issue --- src/app/components/DataMenu.js | 3 ++- src/app/components/FloatButton.js | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/app/components/DataMenu.js b/src/app/components/DataMenu.js index 8746b50..3b5e61c 100644 --- a/src/app/components/DataMenu.js +++ b/src/app/components/DataMenu.js @@ -56,13 +56,14 @@ export default class DataMenu extends Component { render() { const screenHeight = Dimensions.get("window").height; + const screenWidth = Dimensions.get("window").width; const { layers, selectedValue } = this.state; return ( 600 ? 0 : screenHeight * 0.09) }}> diff --git a/src/app/components/FloatButton.js b/src/app/components/FloatButton.js index 4d94bba..c0a0552 100644 --- a/src/app/components/FloatButton.js +++ b/src/app/components/FloatButton.js @@ -21,7 +21,7 @@ import { Dimensions } from "react-native"; const screenWidth = Dimensions.get("window").width; const screenHeight = Dimensions.get("window").height; -console.log(screenHeight); + function FloatButton(props) { const animation = useRef(new Animated.Value(0)).current; @@ -35,6 +35,7 @@ function FloatButton(props) { friction: 6, useNativeDriver: true, }).start(); + console.log(open); setOpen(!open); }; @@ -49,7 +50,7 @@ function FloatButton(props) { ], }; - const cameraStyle = { + const menuStyle = { transform: [ { scale: animation }, { @@ -62,11 +63,14 @@ function FloatButton(props) { }; return ( - - + + - + @@ -87,8 +91,7 @@ const styles = StyleSheet.create({ alignItems: "center", position: "absolute", bottom: 0, - left: 0, - flex: 1, + right: 0, }, button: { width: 50, @@ -105,10 +108,6 @@ const styles = StyleSheet.create({ menu: { backgroundColor: colors.primary, }, - submenu: { - width: screenWidth, - flex: 1, - }, }); export default FloatButton;