mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
all state migrated to zustand, jotai removed
splash page now waits on state hydration from db
This commit is contained in:
32
app/App.tsx
32
app/App.tsx
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user