mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-09 04:19:55 -06:00
omg plz
This commit is contained in:
@@ -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;
|
||||
7
components/CarPlay/NowPlaying.tsx
Normal file
7
components/CarPlay/NowPlaying.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { NowPlayingTemplate } from "react-native-carplay";
|
||||
|
||||
const CarPlayNowPlaying : NowPlayingTemplate = new NowPlayingTemplate({
|
||||
|
||||
})
|
||||
|
||||
export default CarPlayNowPlaying;
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user