mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 15:29:15 +01:00
handle notification click link
also correctly handle back on now playing from app open standardize route names
This commit is contained in:
@@ -1,18 +1,40 @@
|
||||
import BottomTabNavigator from '@app/navigation/BottomTabNavigator'
|
||||
import NowPlayingLayout from '@app/screens/NowPlayingLayout'
|
||||
import colors from '@app/styles/colors'
|
||||
import { DarkTheme, NavigationContainer } from '@react-navigation/native'
|
||||
import React from 'react'
|
||||
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
||||
import NowPlayingLayout from '@app/screens/NowPlayingLayout'
|
||||
import BottomTabNavigator from '@app/navigation/BottomTabNavigator'
|
||||
|
||||
const RootStack = createNativeStackNavigator()
|
||||
|
||||
const theme = { ...DarkTheme }
|
||||
theme.colors.background = colors.gradient.high
|
||||
|
||||
const RootNavigator = () => (
|
||||
<RootStack.Navigator
|
||||
screenOptions={{
|
||||
headerShown: false,
|
||||
<NavigationContainer
|
||||
theme={theme}
|
||||
linking={{
|
||||
prefixes: ['trackplayer'],
|
||||
config: {
|
||||
screens: {
|
||||
main: {
|
||||
path: ':/main',
|
||||
},
|
||||
'now-playing': {
|
||||
path: ':/notification.click',
|
||||
},
|
||||
},
|
||||
},
|
||||
}}>
|
||||
<RootStack.Screen name="Main" component={BottomTabNavigator} />
|
||||
<RootStack.Screen name="NowPlaying" component={NowPlayingLayout} />
|
||||
</RootStack.Navigator>
|
||||
<RootStack.Navigator
|
||||
screenOptions={{
|
||||
headerShown: false,
|
||||
}}
|
||||
initialRouteName="main">
|
||||
<RootStack.Screen name="main" component={BottomTabNavigator} />
|
||||
<RootStack.Screen name="now-playing" component={NowPlayingLayout} />
|
||||
</RootStack.Navigator>
|
||||
</NavigationContainer>
|
||||
)
|
||||
|
||||
export default RootNavigator
|
||||
|
||||
Reference in New Issue
Block a user