Can this at least work?

This commit is contained in:
Violet Caulfield
2025-01-24 23:36:35 -06:00
parent 0f10aab2cb
commit 91f4a2d313
4 changed files with 13 additions and 53 deletions
+10
View File
@@ -0,0 +1,10 @@
import { View } from "tamagui";
import { Text } from "../Global/helpers/text";
export default function CarPlayHome() : React.JSX.Element {
return (
<View>
<Text>Yeet</Text>
</View>
)
}
-37
View File
@@ -1,37 +0,0 @@
import React, {useEffect} from 'react';
import {Text, View} from 'react-native';
import {CarPlay, NowPlayingTemplate} from 'react-native-carplay';
export function NowPlaying() {
useEffect(() => {
const template = new NowPlayingTemplate({
albumArtistButtonEnabled: true,
buttons: [
{
id: "favorite",
type: "add-to-library"
}
],
upNextButtonEnabled: false,
onButtonPressed(e) {
console.log(e);
},
});
CarPlay.enableNowPlaying(true);
CarPlay.pushTemplate(template);
return () => {};
}, []);
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Text>Now Playing</Text>
</View>
);
}
NowPlaying.navigationOptions = {
headerTitle: 'Now Playing Template',
};
-13
View File
@@ -1,13 +0,0 @@
import { createStackNavigator } from "@react-navigation/stack"
import { NowPlaying } from "./CarPlay/NowPlaying";
const Stack = createStackNavigator();
export default function JellifyCarplay(): React.JSX.Element {
return (
<Stack.Navigator initialRouteName="NowPlaying">
<Stack.Screen name="NowPlaying" component={NowPlaying} />
</Stack.Navigator>
)
}
+3 -3
View File
@@ -13,7 +13,7 @@ import Client from "../api/client";
import { JellifyProvider, useJellifyContext } from "./provider";
import { CarPlay } from "react-native-carplay"
import { createStackNavigator } from "@react-navigation/stack";
import { NowPlaying } from "./CarPlay/NowPlaying";
import CarPlayHome from "./CarPlay/Home";
export default function Jellify(): React.JSX.Element {
@@ -63,8 +63,8 @@ function App(): React.JSX.Element {
return carPlayConnected ? (
<NavigationContainer>
{ loggedIn ? (
<CarPlayStack.Navigator initialRouteName="NowPlaying">
<CarPlayStack.Screen name="NowPlaying" component={NowPlaying} />
<CarPlayStack.Navigator initialRouteName="Home">
<CarPlayStack.Screen name="Home" component={CarPlayHome} />
</CarPlayStack.Navigator>
) : (
<View>