upgrade react naviggation

This commit is contained in:
Violet Caulfield
2025-02-09 07:03:42 -06:00
parent b79216ee7c
commit 0a267cf37e
4 changed files with 126 additions and 68 deletions

View File

@@ -2,6 +2,7 @@ import Client from "../api/client";
import { isUndefined } from "lodash";
import { createContext, ReactNode, SetStateAction, useContext, useEffect, useState } from "react";
import { CarPlay } from "react-native-carplay";
import CarPlayNavigation from "./CarPlay/Navigation";
interface JellifyContext {
loggedIn: boolean;
@@ -26,14 +27,14 @@ const JellifyContextInitializer = () => {
function onConnect() {
setCarPlayConnected(true);
// CarPlay.setRootTemplate(CarPlayNowPlaying, true);
CarPlay.setRootTemplate(CarPlayNavigation, true);
CarPlay.enableNowPlaying(true);
}
function onDisconnect() {
setCarPlayConnected(false);
}
CarPlay.registerOnConnect(onConnect);
CarPlay.registerOnDisconnect(onDisconnect);
return () => {

View File

@@ -1,15 +1,47 @@
import { DarkTheme, DefaultTheme } from "@react-navigation/native";
import { getTokens } from "tamagui";
export const JellifyDarkTheme = {
interface Fonts {
regular: FontStyle;
medium: FontStyle;
bold: FontStyle;
heavy: FontStyle;
}
interface FontStyle {
fontFamily: string;
fontWeight: "normal" | "bold" | "200" | "900" | "100" | "500" | "300" | "400" | "600" | "700" | "800"
}
const JellifyFonts : Fonts = {
regular: {
fontFamily: 'Aileron SemiBold',
fontWeight: 'normal'
},
medium: {
fontFamily: 'Aileron Heavy',
fontWeight: 'normal'
},
bold: {
fontFamily: 'Aileron Bold',
fontWeight: 'bold'
},
heavy: {
fontFamily: 'Aileron Black',
fontWeight: 'bold'
},
};
export const JellifyDarkTheme : ReactNavigation.Theme = {
dark: true,
colors: {
...DarkTheme.colors,
card: getTokens().color.$purpleDark.val,
border: getTokens().color.$amethyst.val,
background: getTokens().color.$purpleDark.val,
primary: getTokens().color.$telemagenta.val,
},
dark: true
},
fonts: JellifyFonts
};
export const JellifyLightTheme = {
@@ -17,5 +49,6 @@ export const JellifyLightTheme = {
colors: {
...DefaultTheme.colors,
primary: getTokens().color.$telemagenta.val
}
},
fonts: JellifyFonts
};

140
package-lock.json generated
View File

@@ -13,10 +13,10 @@
"@react-native-community/cli": "^15.1.3",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-masked-view/masked-view": "^0.3.1",
"@react-navigation/bottom-tabs": "^6.6.1",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@react-navigation/stack": "^6.4.1",
"@react-navigation/bottom-tabs": "^7.2.0",
"@react-navigation/native": "^7.0.14",
"@react-navigation/native-stack": "^7.1.1",
"@react-navigation/stack": "^7.1.0",
"@tamagui/config": "^1.123.8",
"@tanstack/query-sync-storage-persister": "^5.62.0",
"@tanstack/react-query": "^5.52.1",
@@ -3836,111 +3836,126 @@
}
},
"node_modules/@react-navigation/bottom-tabs": {
"version": "6.6.1",
"resolved": "https://registry.npmjs.org/@react-navigation/bottom-tabs/-/bottom-tabs-6.6.1.tgz",
"integrity": "sha512-9oD4cypEBjPuaMiu9tevWGiQ4w/d6l3HNhcJ1IjXZ24xvYDSs0mqjUcdt8SWUolCvRrYc/DmNBLlT83bk0bHTw==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@react-navigation/bottom-tabs/-/bottom-tabs-7.2.0.tgz",
"integrity": "sha512-1LxjgnbPyFINyf9Qr5d1YE0pYhuJayg5TCIIFQmbcX4PRhX7FKUXV7cX8OzrKXEdZi/UE/VNXugtozPAR9zgvA==",
"license": "MIT",
"dependencies": {
"@react-navigation/elements": "^1.3.31",
"color": "^4.2.3",
"warn-once": "^0.1.0"
"@react-navigation/elements": "^2.2.5",
"color": "^4.2.3"
},
"peerDependencies": {
"@react-navigation/native": "^6.0.0",
"react": "*",
"@react-navigation/native": "^7.0.14",
"react": ">= 18.2.0",
"react-native": "*",
"react-native-safe-area-context": ">= 3.0.0",
"react-native-screens": ">= 3.0.0"
"react-native-safe-area-context": ">= 4.0.0",
"react-native-screens": ">= 4.0.0"
}
},
"node_modules/@react-navigation/core": {
"version": "6.4.17",
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-6.4.17.tgz",
"integrity": "sha512-Nd76EpomzChWAosGqWOYE3ItayhDzIEzzZsT7PfGcRFDgW5miHV2t4MZcq9YIK4tzxZjVVpYbIynOOQQd1e0Cg==",
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/@react-navigation/core/-/core-7.3.1.tgz",
"integrity": "sha512-S3KCGvNsoqVk8ErAtQI2EAhg9185lahF5OY01ofrrD4Ij/uk3QEHHjoGQhR5l5DXSCSKr1JbMQA7MEKMsBiWZA==",
"license": "MIT",
"dependencies": {
"@react-navigation/routers": "^6.1.9",
"@react-navigation/routers": "^7.1.2",
"escape-string-regexp": "^4.0.0",
"nanoid": "^3.1.23",
"nanoid": "3.3.8",
"query-string": "^7.1.3",
"react-is": "^16.13.0",
"use-latest-callback": "^0.2.1"
"react-is": "^18.2.0",
"use-latest-callback": "^0.2.1",
"use-sync-external-store": "^1.2.2"
},
"peerDependencies": {
"react": "*"
"react": ">= 18.2.0"
}
},
"node_modules/@react-navigation/core/node_modules/react-is": {
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz",
"integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==",
"license": "MIT"
},
"node_modules/@react-navigation/elements": {
"version": "1.3.31",
"resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-1.3.31.tgz",
"integrity": "sha512-bUzP4Awlljx5RKEExw8WYtif8EuQni2glDaieYROKTnaxsu9kEIA515sXQgUDZU4Ob12VoL7+z70uO3qrlfXcQ==",
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/@react-navigation/elements/-/elements-2.2.5.tgz",
"integrity": "sha512-sDhE+W14P7MNWLMxXg1MEVXwkLUpMZJGflE6nQNzLmolJQIHgcia0Mrm8uRa3bQovhxYu1UzEojLZ+caoZt7Fg==",
"license": "MIT",
"dependencies": {
"color": "^4.2.3"
},
"peerDependencies": {
"@react-navigation/native": "^6.0.0",
"react": "*",
"@react-native-masked-view/masked-view": ">= 0.2.0",
"@react-navigation/native": "^7.0.14",
"react": ">= 18.2.0",
"react-native": "*",
"react-native-safe-area-context": ">= 3.0.0"
"react-native-safe-area-context": ">= 4.0.0"
},
"peerDependenciesMeta": {
"@react-native-masked-view/masked-view": {
"optional": true
}
}
},
"node_modules/@react-navigation/native": {
"version": "6.1.18",
"resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-6.1.18.tgz",
"integrity": "sha512-mIT9MiL/vMm4eirLcmw2h6h/Nm5FICtnYSdohq4vTLA2FF/6PNhByM7s8ffqoVfE5L0uAa6Xda1B7oddolUiGg==",
"version": "7.0.14",
"resolved": "https://registry.npmjs.org/@react-navigation/native/-/native-7.0.14.tgz",
"integrity": "sha512-Gi6lLw4VOGSWAhmUdJOMauOKGK51/YA1CprjXm91sNfgERWvznqEMw8QmUQx9SEqYfi0LfZhbzpMst09SJ00lw==",
"license": "MIT",
"dependencies": {
"@react-navigation/core": "^6.4.17",
"@react-navigation/core": "^7.3.1",
"escape-string-regexp": "^4.0.0",
"fast-deep-equal": "^3.1.3",
"nanoid": "^3.1.23"
"nanoid": "3.3.8",
"use-latest-callback": "^0.2.1"
},
"peerDependencies": {
"react": "*",
"react": ">= 18.2.0",
"react-native": "*"
}
},
"node_modules/@react-navigation/native-stack": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/@react-navigation/native-stack/-/native-stack-6.11.0.tgz",
"integrity": "sha512-U5EcUB9Q2NQspCFwYGGNJm0h6wBCOv7T30QjndmvlawLkNt7S7KWbpWyxS9XBHSIKF57RgWjfxuJNTgTstpXxw==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@react-navigation/native-stack/-/native-stack-7.2.0.tgz",
"integrity": "sha512-mw7Nq9qQrGsmJmCTwIIWB7yY/3tWYXvQswx+HJScGAadIjemvytJXm1fcl3+YZ9T9Ym0aERcVe5kDs+ny3X4vA==",
"license": "MIT",
"dependencies": {
"@react-navigation/elements": "^1.3.31",
"warn-once": "^0.1.0"
"@react-navigation/elements": "^2.2.5",
"warn-once": "^0.1.1"
},
"peerDependencies": {
"@react-navigation/native": "^6.0.0",
"react": "*",
"@react-navigation/native": "^7.0.14",
"react": ">= 18.2.0",
"react-native": "*",
"react-native-safe-area-context": ">= 3.0.0",
"react-native-screens": ">= 3.0.0"
"react-native-safe-area-context": ">= 4.0.0",
"react-native-screens": ">= 4.0.0"
}
},
"node_modules/@react-navigation/routers": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@react-navigation/routers/-/routers-6.1.9.tgz",
"integrity": "sha512-lTM8gSFHSfkJvQkxacGM6VJtBt61ip2XO54aNfswD+KMw6eeZ4oehl7m0me3CR9hnDE4+60iAZR8sAhvCiI3NA==",
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/@react-navigation/routers/-/routers-7.1.2.tgz",
"integrity": "sha512-emdEjpVDK8zbiu2GChC8oYIAub9i/OpNuQJekVsbyFCBz4/TzaBzms38Q53YaNhdIFNmiYLfHv/Y1Ub7KYfm3w==",
"license": "MIT",
"dependencies": {
"nanoid": "^3.1.23"
"nanoid": "3.3.8"
}
},
"node_modules/@react-navigation/stack": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/@react-navigation/stack/-/stack-6.4.1.tgz",
"integrity": "sha512-upMEHOKMtuMu4c9gmoPlO/JqI6mDlSqwXg1aXKOTQLXAF8H5koOLRfrmi7AkdiE9A7lDXWUAZoGuD9O88cYvDQ==",
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/@react-navigation/stack/-/stack-7.1.1.tgz",
"integrity": "sha512-CBTKQlIkELp05zRiTAv5Pa7OMuCpKyBXcdB3PGMN2Mm55/5MkDsA1IaZorp/6TsVCdllITD6aTbGX/HA/88A6w==",
"license": "MIT",
"dependencies": {
"@react-navigation/elements": "^1.3.31",
"color": "^4.2.3",
"warn-once": "^0.1.0"
"@react-navigation/elements": "^2.2.5",
"color": "^4.2.3"
},
"peerDependencies": {
"@react-navigation/native": "^6.0.0",
"react": "*",
"@react-navigation/native": "^7.0.14",
"react": ">= 18.2.0",
"react-native": "*",
"react-native-gesture-handler": ">= 1.0.0",
"react-native-safe-area-context": ">= 3.0.0",
"react-native-screens": ">= 3.0.0"
"react-native-gesture-handler": ">= 2.0.0",
"react-native-safe-area-context": ">= 4.0.0",
"react-native-screens": ">= 4.0.0"
}
},
"node_modules/@sideway/address": {
@@ -14301,6 +14316,15 @@
}
}
},
"node_modules/use-sync-external-store": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.4.0.tgz",
"integrity": "sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==",
"license": "MIT",
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",

View File

@@ -22,10 +22,10 @@
"@react-native-community/cli": "^15.1.3",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-masked-view/masked-view": "^0.3.1",
"@react-navigation/bottom-tabs": "^6.6.1",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@react-navigation/stack": "^6.4.1",
"@react-navigation/bottom-tabs": "^7.2.0",
"@react-navigation/native": "^7.0.14",
"@react-navigation/native-stack": "^7.1.1",
"@react-navigation/stack": "^7.1.0",
"@tamagui/config": "^1.123.8",
"@tanstack/query-sync-storage-persister": "^5.62.0",
"@tanstack/react-query": "^5.52.1",