This commit is contained in:
Violet Caulfield
2025-01-25 17:35:41 -06:00
parent e0c2cf333d
commit 71ba0640e6
3 changed files with 19 additions and 6 deletions

View File

@@ -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;

View File

@@ -0,0 +1,7 @@
import { NowPlayingTemplate } from "react-native-carplay";
const CarPlayNowPlaying : NowPlayingTemplate = new NowPlayingTemplate({
})
export default CarPlayNowPlaying;

View File

@@ -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() {