all state migrated to zustand, jotai removed

splash page now waits on state hydration from db
This commit is contained in:
austinried
2021-08-04 13:13:32 +09:00
parent 33dc0be02b
commit 706e57aa77
23 changed files with 427 additions and 660 deletions

View File

@@ -1,21 +1,27 @@
import React from 'react'
import SplashPage from '@app/screens/SplashPage'
import RootNavigator from '@app/navigation/RootNavigator'
import { Provider } from 'jotai'
import { StatusBar, View } from 'react-native'
import SplashPage from '@app/screens/SplashPage'
import colors from '@app/styles/colors'
import TrackPlayerState from '@app/components/TrackPlayerState'
import React from 'react'
import { StatusBar, View } from 'react-native'
import ProgressHook from './components/ProgressHook'
import { useStore } from './state/store'
import { selectTrackPlayer } from './state/trackplayer'
const Debug = () => {
const currentTrack = useStore(selectTrackPlayer.currentTrack)
console.log(currentTrack?.title)
return <></>
}
const App = () => (
<Provider>
<View style={{ flex: 1, backgroundColor: colors.gradient.high }}>
<StatusBar animated={true} backgroundColor={'rgba(0, 0, 0, 0.4)'} barStyle={'light-content'} translucent={true} />
<TrackPlayerState />
<View style={{ flex: 1, backgroundColor: colors.gradient.high }}>
<SplashPage>
<RootNavigator />
</SplashPage>
</View>
</Provider>
<SplashPage>
<ProgressHook />
<Debug />
<RootNavigator />
</SplashPage>
</View>
)
export default App