Extract shell state into separate context (#1824)
* WIP * Add shell state * Integrate new shell state for drawer and minimal shell mode * Replace isDrawerSwipeDisabled * Split shell state into separate contexts to avoid needless re-renders * Fix typo --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
parent
7158157f5f
commit
bfe196bac5
51 changed files with 368 additions and 238 deletions
|
@ -9,6 +9,7 @@ import {usePalette} from 'lib/hooks/usePalette'
|
|||
import {useStores} from 'state/index'
|
||||
import {useAnalytics} from 'lib/analytics/analytics'
|
||||
import {SplashScreen} from './SplashScreen'
|
||||
import {useSetMinimalShellMode} from '#/state/shell/minimal-mode'
|
||||
|
||||
enum ScreenState {
|
||||
S_LoginOrCreateAccount,
|
||||
|
@ -19,6 +20,7 @@ enum ScreenState {
|
|||
export const LoggedOut = observer(function LoggedOutImpl() {
|
||||
const pal = usePalette('default')
|
||||
const store = useStores()
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
const {screen} = useAnalytics()
|
||||
const [screenState, setScreenState] = React.useState<ScreenState>(
|
||||
ScreenState.S_LoginOrCreateAccount,
|
||||
|
@ -26,8 +28,8 @@ export const LoggedOut = observer(function LoggedOutImpl() {
|
|||
|
||||
React.useEffect(() => {
|
||||
screen('Login')
|
||||
store.shell.setMinimalShellMode(true)
|
||||
}, [store, screen])
|
||||
setMinimalShellMode(true)
|
||||
}, [screen, setMinimalShellMode])
|
||||
|
||||
if (
|
||||
store.session.isResumingSession ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue