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:
Eric Bailey
2023-11-07 13:37:47 -06:00
committed by GitHub
parent 7158157f5f
commit bfe196bac5
51 changed files with 368 additions and 238 deletions
+4 -2
View File
@@ -8,14 +8,16 @@ import {useStores} from 'state/index'
import {Welcome} from './onboarding/Welcome'
import {RecommendedFeeds} from './onboarding/RecommendedFeeds'
import {RecommendedFollows} from './onboarding/RecommendedFollows'
import {useSetMinimalShellMode} from '#/state/shell/minimal-mode'
export const Onboarding = observer(function OnboardingImpl() {
const pal = usePalette('default')
const store = useStores()
const setMinimalShellMode = useSetMinimalShellMode()
React.useEffect(() => {
store.shell.setMinimalShellMode(true)
}, [store])
setMinimalShellMode(true)
}, [setMinimalShellMode])
const next = () => store.onboarding.next()
const skip = () => store.onboarding.skip()