mirror of
https://github.com/Jellify-Music/App.git
synced 2025-12-30 15:29:49 -06:00
navigate from player to artist
This commit is contained in:
@@ -10,8 +10,10 @@ import { queryConfig } from "../../api/queries/query.config";
|
||||
import { Text } from "../Global/text";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { playPauseButton } from "./helpers/buttons";
|
||||
import { BottomTabNavigationEventMap } from "@react-navigation/bottom-tabs";
|
||||
import { NavigationHelpers, ParamListBase } from "@react-navigation/native";
|
||||
|
||||
export default function Player(): React.JSX.Element {
|
||||
export default function Player({ navigation }: { navigation : NavigationHelpers<ParamListBase, BottomTabNavigationEventMap> }): React.JSX.Element {
|
||||
|
||||
const { apiClient } = useApiClientContext();
|
||||
const { queue, playbackState, nowPlaying, play, pause } = usePlayerContext();
|
||||
@@ -44,7 +46,17 @@ export default function Player(): React.JSX.Element {
|
||||
|
||||
<YStack>
|
||||
<Text>{nowPlaying?.title ?? "Untitled Track"}</Text>
|
||||
<Text bold>{nowPlaying?.artist ?? "Unknown Artist"}</Text>
|
||||
<Text
|
||||
bold
|
||||
onPress={() => {
|
||||
navigation.goBack();
|
||||
navigation.navigate("Artist", {
|
||||
artistName: nowPlaying?.artist,
|
||||
artistId: nowPlaying?.ArtistId
|
||||
})
|
||||
}}
|
||||
>
|
||||
{nowPlaying?.artist ?? "Unknown Artist"}</Text>
|
||||
</YStack>
|
||||
|
||||
<HStack>
|
||||
|
||||
@@ -35,6 +35,7 @@ export function mapDtoToTrack(api: Api, sessionId: string, item: BaseItemDto, qu
|
||||
duration: item.RunTimeTicks,
|
||||
|
||||
ItemId: item.Id!,
|
||||
ArtistId: item.ParentId,
|
||||
AlbumId: item.AlbumId!,
|
||||
QueuingType: queuingType ?? QueuingType.DirectlyQueued
|
||||
} as JellifyTrack
|
||||
|
||||
@@ -21,6 +21,7 @@ export interface JellifyTrack extends Track {
|
||||
isLiveStream?: boolean | undefined;
|
||||
|
||||
ItemId: string;
|
||||
ArtistId: string;
|
||||
AlbumId: string;
|
||||
Year?: number | null | undefined;
|
||||
IndexNumber?: number | null | undefined;
|
||||
|
||||
Reference in New Issue
Block a user