2020-06-16 17:51:51 +02:00
|
|
|
import React from 'react';
|
2020-06-17 14:58:04 +02:00
|
|
|
import { createBottomTabNavigator, BottomTabNavigationProp } from '@react-navigation/bottom-tabs';
|
2020-06-16 17:51:51 +02:00
|
|
|
import Player from './Player';
|
2020-06-21 13:02:23 +02:00
|
|
|
import Music from './Music';
|
2020-06-16 23:11:05 +02:00
|
|
|
import Settings from './Settings';
|
2020-06-17 14:58:04 +02:00
|
|
|
import { createStackNavigator, StackNavigationProp } from '@react-navigation/stack';
|
|
|
|
|
import SetJellyfinServer from './modals/SetJellyfinServer';
|
|
|
|
|
import { CompositeNavigationProp } from '@react-navigation/native';
|
2020-06-16 17:51:51 +02:00
|
|
|
|
2020-06-17 14:58:04 +02:00
|
|
|
const Stack = createStackNavigator();
|
2020-06-16 17:51:51 +02:00
|
|
|
const Tab = createBottomTabNavigator();
|
|
|
|
|
|
2020-06-17 14:58:04 +02:00
|
|
|
type Screens = {
|
|
|
|
|
NowPlaying: undefined;
|
2020-06-21 13:02:23 +02:00
|
|
|
Music: undefined;
|
2020-06-17 14:58:04 +02:00
|
|
|
Settings: undefined;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Screens() {
|
2020-06-16 17:51:51 +02:00
|
|
|
return (
|
|
|
|
|
<Tab.Navigator>
|
2020-06-21 13:02:23 +02:00
|
|
|
<Tab.Screen name="NowPlaying" component={Player} options={{ tabBarLabel: 'Now Playing' }} />
|
|
|
|
|
<Tab.Screen name="Music" component={Music} />
|
2020-06-16 23:11:05 +02:00
|
|
|
<Tab.Screen name="Settings" component={Settings} />
|
2020-06-16 17:51:51 +02:00
|
|
|
</Tab.Navigator>
|
|
|
|
|
);
|
2020-06-17 14:58:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Routes = {
|
|
|
|
|
Screens: undefined;
|
|
|
|
|
SetJellyfinServer: undefined;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default function Routes() {
|
|
|
|
|
return (
|
|
|
|
|
<Stack.Navigator mode="modal" headerMode="none" screenOptions={{
|
|
|
|
|
cardStyle: {
|
|
|
|
|
backgroundColor: 'transparent'
|
|
|
|
|
}
|
|
|
|
|
}}>
|
|
|
|
|
<Stack.Screen name="Screens" component={Screens} />
|
|
|
|
|
<Stack.Screen name="SetJellyfinServer" component={SetJellyfinServer} />
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type NavigationProp = CompositeNavigationProp<
|
|
|
|
|
StackNavigationProp<Routes>,
|
|
|
|
|
BottomTabNavigationProp<Screens>
|
|
|
|
|
>;
|