mirror of
https://github.com/anultravioletaurora/Jellify.git
synced 2026-05-25 00:59:13 -05:00
Can this at least work?
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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',
|
||||
};
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user