Files
jellyfin-audio-player/src/screens/Music/index.tsx

50 lines
2.6 KiB
TypeScript
Raw Normal View History

2020-06-21 13:02:23 +02:00
import React from 'react';
import { StatusBar, StyleSheet } from 'react-native';
2020-06-21 13:02:23 +02:00
import { createStackNavigator } from '@react-navigation/stack';
2022-05-05 22:54:37 +02:00
import { GestureHandlerRootView } from 'react-native-gesture-handler';
2023-06-19 22:26:41 +02:00
import { t } from '@/localisation';
import useDefaultStyles, { ColoredBlurView, useUserOrSystemScheme } from '@/components/Colors';
2023-06-19 23:03:17 +02:00
import { StackParams } from '@/screens/types';
import NowPlaying from './overlays/NowPlaying';
import RecentAlbums from './stacks/RecentAlbums';
import Albums from './stacks/Albums';
import Album from './stacks/Album';
2022-01-01 19:09:21 +01:00
import Playlists from './stacks/Playlists';
import Playlist from './stacks/Playlist';
2023-04-28 23:35:06 +02:00
import Artists from './stacks/Artists';
import Artist from './stacks/Artist';
import { SafeAreaProvider } from 'react-native-safe-area-context';
2020-06-21 13:02:23 +02:00
const Stack = createStackNavigator<StackParams>();
2020-06-21 13:02:23 +02:00
function MusicStack() {
const defaultStyles = useDefaultStyles();
const scheme = useUserOrSystemScheme();
2020-06-21 13:02:23 +02:00
return (
<SafeAreaProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<StatusBar backgroundColor="transparent" barStyle={scheme === 'dark' ? 'light-content' : 'dark-content'} />
<Stack.Navigator initialRouteName="RecentAlbums" screenOptions={{
headerTintColor: defaultStyles.themeColor.color,
headerTitleStyle: defaultStyles.stackHeader,
cardStyle: defaultStyles.view,
headerTransparent: true,
headerBackground: () => <ColoredBlurView style={StyleSheet.absoluteFill} />,
}}>
<Stack.Screen name="RecentAlbums" component={RecentAlbums} options={{ headerTitle: t('recent-albums'), headerShown: false }} />
<Stack.Screen name="Albums" component={Albums} options={{ headerTitle: t('albums') }} />
<Stack.Screen name="Album" component={Album} options={{ headerTitle: t('album') }} />
<Stack.Screen name="Artists" component={Artists} options={{ headerTitle: t('artists') }} />
<Stack.Screen name="Artist" component={Artist} options={({ route }) => ({ headerTitle: route.params.Name })} />
<Stack.Screen name="Playlists" component={Playlists} options={{ headerTitle: t('playlists') }} />
<Stack.Screen name="Playlist" component={Playlist} options={{ headerTitle: t('playlist') }} />
</Stack.Navigator>
<NowPlaying />
</GestureHandlerRootView>
</SafeAreaProvider>
2020-06-21 13:02:23 +02:00
);
}
export default MusicStack;