about summary refs log tree commit diff
path: root/src/view/shell/index.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-04-24 16:36:05 -0500
committerGitHub <noreply@github.com>2023-04-24 16:36:05 -0500
commitda8af38dcc23ea33c686714be2ce5f0bf0e65798 (patch)
tree78156a3b5803ccda6883e9e694ca79ccfdc40473 /src/view/shell/index.tsx
parent9d8600c21387999f8621274c553d5385be0c92c7 (diff)
downloadvoidsky-da8af38dcc23ea33c686714be2ce5f0bf0e65798.tar.zst
Android & visual fixes: color themes, repost icon, navigation, back handler, etc (#519)
* Switch android to use slide left/right animations on navigation

* Bump the repost icon down by a pixel

* Tune theme colors for contrast and darker bg on darkmode

* Move back handler to a point in the init flow that leads to more consistent capture of events

* Fix image share flow on android

* Fix lint

* Add todo about sharing not available

* Drop the android slide animation because it's too slow

* Fix 'flashes of white' in dark mode android
Diffstat (limited to 'src/view/shell/index.tsx')
-rw-r--r--src/view/shell/index.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/view/shell/index.tsx b/src/view/shell/index.tsx
index e0abec777..04ea7c9bf 100644
--- a/src/view/shell/index.tsx
+++ b/src/view/shell/index.tsx
@@ -13,6 +13,7 @@ import {DrawerContent} from './Drawer'
 import {Composer} from './Composer'
 import {useTheme} from 'lib/ThemeContext'
 import {usePalette} from 'lib/hooks/usePalette'
+import * as backHandler from 'lib/routes/back-handler'
 import {RoutesContainer, TabsNavigator} from '../../Navigation'
 import {isStateAtTabRoot} from 'lib/routes/helpers'
 
@@ -34,6 +35,9 @@ const ShellInner = observer(() => {
     [store],
   )
   const canGoBack = useNavigationState(state => !isStateAtTabRoot(state))
+  React.useEffect(() => {
+    backHandler.init(store)
+  }, [store])
 
   return (
     <>
@@ -69,8 +73,8 @@ const ShellInner = observer(() => {
 })
 
 export const Shell: React.FC = observer(() => {
-  const theme = useTheme()
   const pal = usePalette('default')
+  const theme = useTheme()
   return (
     <View testID="mobileShellView" style={[styles.outerContainer, pal.view]}>
       <StatusBar style={theme.colorScheme === 'dark' ? 'light' : 'dark'} />