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

46 lines
2.2 KiB
TypeScript
Raw Normal View History

2020-06-21 13:02:23 +02:00
import React from 'react';
2023-04-28 23:35:06 +02:00
import { 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 { THEME_COLOR } from '@/CONSTANTS';
import { t } from '@/localisation';
import useDefaultStyles, { ColoredBlurView } from '@/components/Colors';
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';
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();
2020-06-21 13:02:23 +02:00
return (
<GestureHandlerRootView style={{ flex: 1 }}>
2022-04-09 15:48:01 +02:00
<Stack.Navigator initialRouteName="RecentAlbums" screenOptions={{
headerTintColor: THEME_COLOR,
headerTitleStyle: defaultStyles.stackHeader,
cardStyle: defaultStyles.view,
2023-04-22 23:31:37 +02:00
headerTransparent: true,
headerBackground: () => <ColoredBlurView style={StyleSheet.absoluteFill} />,
2022-04-09 15:48:01 +02:00
}}>
2023-04-22 23:31:37 +02:00
<Stack.Screen name="RecentAlbums" component={RecentAlbums} options={{ headerTitle: t('recent-albums'), headerShown: false }} />
2022-04-09 15:48:01 +02:00
<Stack.Screen name="Albums" component={Albums} options={{ headerTitle: t('albums') }} />
<Stack.Screen name="Album" component={Album} options={{ headerTitle: t('album') }} />
2023-04-28 23:35:06 +02:00
<Stack.Screen name="Artists" component={Artists} options={{ headerTitle: t('artists') }} />
<Stack.Screen name="Artist" component={Artist} options={({ route }) => ({ headerTitle: route.params.Name })} />
2022-04-09 15:48:01 +02:00
<Stack.Screen name="Playlists" component={Playlists} options={{ headerTitle: t('playlists') }} />
<Stack.Screen name="Playlist" component={Playlist} options={{ headerTitle: t('playlist') }} />
</Stack.Navigator>
<NowPlaying />
2022-05-05 22:54:37 +02:00
</GestureHandlerRootView>
2020-06-21 13:02:23 +02:00
);
}
export default MusicStack;