diff --git a/components/CarPlay/Home.tsx b/components/CarPlay/Home.tsx index 3516b167..2b53111f 100644 --- a/components/CarPlay/Home.tsx +++ b/components/CarPlay/Home.tsx @@ -1,12 +1,15 @@ -import { View } from "tamagui"; -import { Text } from "../Global/helpers/text"; +import { fetchRecentlyPlayedArtists } from "@/api/queries/functions/recents"; import { GridTemplate } from "react-native-carplay"; +const recentArtists = fetchRecentlyPlayedArtists() + const CarPlayHome : GridTemplate = new GridTemplate({ title: "Home", - buttons: [ - - ] + buttons: Array.from({ length: 8 }).map((_, i) => ({ + id: `BUTTON_${i}`, + image: require("../../assets/icon_60pt_3x.jpg"), + titleVariants: [`Item ${i}`] + })) }); export default CarPlayHome; \ No newline at end of file diff --git a/components/CarPlay/NowPlaying.tsx b/components/CarPlay/NowPlaying.tsx new file mode 100644 index 00000000..c0ff8a76 --- /dev/null +++ b/components/CarPlay/NowPlaying.tsx @@ -0,0 +1,7 @@ +import { NowPlayingTemplate } from "react-native-carplay"; + +const CarPlayNowPlaying : NowPlayingTemplate = new NowPlayingTemplate({ + +}) + +export default CarPlayNowPlaying; \ No newline at end of file diff --git a/components/provider.tsx b/components/provider.tsx index 7304953a..313f82f0 100644 --- a/components/provider.tsx +++ b/components/provider.tsx @@ -3,6 +3,7 @@ import { isUndefined } from "lodash"; import { createContext, ReactNode, useContext, useEffect, useState } from "react"; import { CarPlay } from "react-native-carplay"; import CarPlayNavigation from "./CarPlay/Navigation"; +import CarPlayNowPlaying from "./CarPlay/NowPlaying"; interface JellifyContext { loggedIn: boolean; @@ -23,7 +24,9 @@ const JellifyContextInitializer = () => { function onConnect() { setCarPlayConnected(true); - CarPlay.setRootTemplate(CarPlayNavigation) + CarPlay.setRootTemplate(CarPlayNavigation); + CarPlay.enableNowPlaying(true); + CarPlay.pushTemplate(CarPlayNowPlaying) } function onDisconnect() {