about summary refs log tree commit diff
path: root/src/view/shell/mobile/index.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-12-12 10:48:36 -0600
committerPaul Frazee <pfrazee@gmail.com>2022-12-12 10:48:36 -0600
commit03d9fd3179f9224afe08bce930a1133f5ad2f7b2 (patch)
tree43da87a120746feaa4cab056352ecae2e6f74e8f /src/view/shell/mobile/index.tsx
parent5fa3c16d0d374c7c09616b845a9cdf42c826c806 (diff)
downloadvoidsky-03d9fd3179f9224afe08bce930a1133f5ad2f7b2.tar.zst
More aesthetic and perf improvements to the menu drawer
Diffstat (limited to 'src/view/shell/mobile/index.tsx')
-rw-r--r--src/view/shell/mobile/index.tsx15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/view/shell/mobile/index.tsx b/src/view/shell/mobile/index.tsx
index 1506b52e6..ef980066c 100644
--- a/src/view/shell/mobile/index.tsx
+++ b/src/view/shell/mobile/index.tsx
@@ -245,18 +245,19 @@ export const MobileShell: React.FC = observer(() => {
     ? {transform: [{translateX: swipeTranslateX}]}
     : undefined
   let menuTranslateX
+  const menuDrawerWidth = winDim.width - 100
   if (isMenuActive) {
     // menu is active, interpret swipes as closes
-    menuTranslateX = Animated.multiply(swipeGestureInterp, winDim.width * -1)
+    menuTranslateX = Animated.multiply(swipeGestureInterp, menuDrawerWidth * -1)
   } else if (!store.nav.tab.canGoBack) {
     // at back of history, interpret swipes as opens
     menuTranslateX = Animated.subtract(
-      winDim.width * -1,
-      Animated.multiply(swipeGestureInterp, winDim.width),
+      menuDrawerWidth * -1,
+      Animated.multiply(swipeGestureInterp, menuDrawerWidth),
     )
   } else {
     // not at back of history, leave off screen
-    menuTranslateX = winDim.width * -1
+    menuTranslateX = menuDrawerWidth * -1
   }
   const menuSwipeTransform = {
     transform: [{translateX: menuTranslateX}],
@@ -369,7 +370,7 @@ export const MobileShell: React.FC = observer(() => {
               },
             )}
           </ScreenContainer>
-          {menuSwipingDirection !== 0 ? (
+          {isMenuActive || menuSwipingDirection !== 0 ? (
             <Animated.View style={[styles.screenMask, menuSwipeOpacity]} />
           ) : undefined}
           <Animated.View style={[styles.menuDrawer, menuSwipeTransform]}>
@@ -500,14 +501,14 @@ const styles = StyleSheet.create({
     left: 0,
     right: 0,
     backgroundColor: '#000',
-    opacity: 0.5,
+    opacity: 0.6,
   },
   menuDrawer: {
     position: 'absolute',
     top: 0,
     bottom: 0,
     left: 0,
-    right: 0,
+    right: 100,
   },
   topBarProtector: {
     position: 'absolute',