import React, { useMemo } from "react"; import { getTokens, useTheme, View, XStack, YStack } from "tamagui"; import { usePlayerContext } from "../../player/provider"; import { BottomTabNavigationEventMap } from "@react-navigation/bottom-tabs"; import { NavigationHelpers, ParamListBase } from "@react-navigation/native"; import Icon from "../Global/helpers/icon"; import { Text } from "../Global/helpers/text"; import TextTicker from 'react-native-text-ticker'; import PlayPauseButton from "./helpers/buttons"; import { useSafeAreaFrame } from "react-native-safe-area-context"; import { TextTickerConfig } from "./component.config"; import BlurhashedImage from "../Global/components/blurhashed-image"; export function Miniplayer({ navigation }: { navigation : NavigationHelpers }) : React.JSX.Element { const theme = useTheme(); const { nowPlaying, useSkip } = usePlayerContext(); const { width } = useSafeAreaFrame(); return ( { nowPlaying && ( navigation.navigate("Player")} > {/** Memoize TextTickers otherwise they won't animate due to the progress being updated in the PlayerContext */} { useMemo(() => { return ( {nowPlaying?.title ?? "Nothing Playing"} {nowPlaying?.artist ?? ""} ) }, [ nowPlaying ])} useSkip.mutate(undefined)} /> )} ) }