From 11f0d165154c5e26706b98bd2caca7bc180b0916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB?= Date: Fri, 7 Aug 2026 12:41:04 +0200 Subject: [PATCH] fix: resolve import paths and module loading errors --- .../WatchConnectivityModule.podspec | 21 ++ .../expo-module.config.json | 7 + .../watch-connectivity/index.swift | 3 +- modules/watch-connectivity/package.json | 4 + package-lock.json | 325 ++++++++++++++++++ package.json | 1 + .../active-workout/screens/PreSwimScreen.tsx | 4 +- .../settings/screens/SettingsScreen.tsx | 2 +- .../hooks/useSyncWorkout.ts | 2 +- .../hooks/useWatchConnection.ts | 2 +- .../hooks/useWatchReachability.ts | 2 +- src/modules/watch-connectivity/index.ts | 17 +- src/providers/WatchProvider.tsx | 4 +- targets/watch/ContentView.swift | 4 +- tsconfig.json | 4 +- 15 files changed, 388 insertions(+), 14 deletions(-) create mode 100644 modules/watch-connectivity/WatchConnectivityModule.podspec create mode 100644 modules/watch-connectivity/expo-module.config.json rename {src/modules => modules}/watch-connectivity/index.swift (96%) create mode 100644 modules/watch-connectivity/package.json diff --git a/modules/watch-connectivity/WatchConnectivityModule.podspec b/modules/watch-connectivity/WatchConnectivityModule.podspec new file mode 100644 index 0000000..4e25842 --- /dev/null +++ b/modules/watch-connectivity/WatchConnectivityModule.podspec @@ -0,0 +1,21 @@ +require 'json' + +package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) + +Pod::Spec.new do |s| + s.name = 'WatchConnectivityModule' + s.version = package['version'] + s.summary = 'WatchConnectivity Expo module' + s.homepage = 'https://github.com/swimbuddy' + s.license = 'MIT' + s.author = 'SwimBuddy' + s.source = { git: '' } + s.platform = :ios, '16.4' + s.swift_version = '5.0' + + s.dependency 'ExpoModulesCore' + + s.source_files = '*.swift' + + s.frameworks = 'WatchConnectivity' +end diff --git a/modules/watch-connectivity/expo-module.config.json b/modules/watch-connectivity/expo-module.config.json new file mode 100644 index 0000000..7563deb --- /dev/null +++ b/modules/watch-connectivity/expo-module.config.json @@ -0,0 +1,7 @@ +{ + "platforms": ["ios"], + "ios": { + "modules": ["WatchConnectivityModule"], + "podspecPath": "./WatchConnectivityModule.podspec" + } +} diff --git a/src/modules/watch-connectivity/index.swift b/modules/watch-connectivity/index.swift similarity index 96% rename from src/modules/watch-connectivity/index.swift rename to modules/watch-connectivity/index.swift index 020f790..5952970 100644 --- a/src/modules/watch-connectivity/index.swift +++ b/modules/watch-connectivity/index.swift @@ -1,7 +1,8 @@ import ExpoModulesCore +import WatchConnectivity public class WatchConnectivityModule: Module { - public func definition() -> Definition { + public func definition() -> ModuleDefinition { Name("WatchConnectivity") AsyncFunction("isSupported") { () -> Bool in diff --git a/modules/watch-connectivity/package.json b/modules/watch-connectivity/package.json new file mode 100644 index 0000000..6f2f28c --- /dev/null +++ b/modules/watch-connectivity/package.json @@ -0,0 +1,4 @@ +{ + "name": "watch-connectivity", + "version": "0.1.0" +} diff --git a/package-lock.json b/package-lock.json index 020c990..c9dcad5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@react-navigation/bottom-tabs": "^7.18.14", "@react-navigation/native": "^7.3.14", "@react-navigation/native-stack": "^7.18.6", + "@tailwindcss/postcss": "^4.3.3", "drizzle-orm": "^0.45.2", "expo": "~57.0.10", "expo-sqlite": "~57.0.1", @@ -34,6 +35,18 @@ "typescript": "~6.0.3" } }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@babel/code-frame": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", @@ -3470,6 +3483,274 @@ "integrity": "sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g==", "license": "MIT" }, + "node_modules/@tailwindcss/node": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.3.tgz", + "integrity": "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.24.1", + "jiti": "^2.7.0", + "lightningcss": "1.32.0", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.3.3" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.3.tgz", + "integrity": "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA==", + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.3.3", + "@tailwindcss/oxide-darwin-arm64": "4.3.3", + "@tailwindcss/oxide-darwin-x64": "4.3.3", + "@tailwindcss/oxide-freebsd-x64": "4.3.3", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.3", + "@tailwindcss/oxide-linux-arm64-gnu": "4.3.3", + "@tailwindcss/oxide-linux-arm64-musl": "4.3.3", + "@tailwindcss/oxide-linux-x64-gnu": "4.3.3", + "@tailwindcss/oxide-linux-x64-musl": "4.3.3", + "@tailwindcss/oxide-wasm32-wasi": "4.3.3", + "@tailwindcss/oxide-win32-arm64-msvc": "4.3.3", + "@tailwindcss/oxide-win32-x64-msvc": "4.3.3" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.3.tgz", + "integrity": "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.3.tgz", + "integrity": "sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.3.tgz", + "integrity": "sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.3.tgz", + "integrity": "sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.3.tgz", + "integrity": "sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.3.tgz", + "integrity": "sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.3.tgz", + "integrity": "sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.3.tgz", + "integrity": "sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.3.tgz", + "integrity": "sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.3.tgz", + "integrity": "sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.11.1", + "@emnapi/runtime": "^1.11.1", + "@emnapi/wasi-threads": "^1.2.2", + "@napi-rs/wasm-runtime": "^1.1.4", + "@tybys/wasm-util": "^0.10.2", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.3.tgz", + "integrity": "sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.3.tgz", + "integrity": "sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/postcss": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.3.3.tgz", + "integrity": "sha512-JTSZZGQi1AyKirbLN3azmjVzef92tcX7h+iSqPdaeStyFpGpDlKvvpxeOE8njhbUanbRwr3z8DyzhICWnMtQeg==", + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "@tailwindcss/node": "4.3.3", + "@tailwindcss/oxide": "4.3.3", + "postcss": "^8.5.16", + "tailwindcss": "4.3.3" + } + }, "node_modules/@types/debug": { "version": "4.1.13", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", @@ -4545,6 +4826,19 @@ "node": ">= 0.8" } }, + "node_modules/enhanced-resolve": { + "version": "5.24.5", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.24.5.tgz", + "integrity": "sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/error-stack-parser": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", @@ -5748,6 +6042,15 @@ "integrity": "sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww==", "license": "MIT" }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6214,6 +6517,15 @@ "yallist": "^3.0.2" } }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, "node_modules/makeerror": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", @@ -7969,6 +8281,19 @@ "tailwindcss": "^4.0.0" } }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", diff --git a/package.json b/package.json index 20c2c1f..8d67fda 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@react-navigation/bottom-tabs": "^7.18.14", "@react-navigation/native": "^7.3.14", "@react-navigation/native-stack": "^7.18.6", + "@tailwindcss/postcss": "^4.3.3", "drizzle-orm": "^0.45.2", "expo": "~57.0.10", "expo-sqlite": "~57.0.1", diff --git a/src/features/active-workout/screens/PreSwimScreen.tsx b/src/features/active-workout/screens/PreSwimScreen.tsx index fbd4059..932e120 100644 --- a/src/features/active-workout/screens/PreSwimScreen.tsx +++ b/src/features/active-workout/screens/PreSwimScreen.tsx @@ -5,8 +5,8 @@ import type { NativeStackNavigationProp } from "@react-navigation/native-stack"; import type { RootStackParamList } from "@navigation/types"; import type { RouteProp } from "@react-navigation/native"; import { getWorkoutWithSets } from "@db/operations"; -import { useSyncWorkout } from "../hooks/useSyncWorkout"; -import { useWatchConnection } from "../hooks/useWatchConnection"; +import { useSyncWorkout } from "../../watch-connectivity/hooks/useSyncWorkout"; +import { useWatchConnection } from "../../watch-connectivity/hooks/useWatchConnection"; import { formatDistance } from "@utils/formatDistance"; import { STROKE_COLORS } from "@constants/strokes"; import type { WorkoutSet } from "@types/workout"; diff --git a/src/features/settings/screens/SettingsScreen.tsx b/src/features/settings/screens/SettingsScreen.tsx index 89df3cf..249ff93 100644 --- a/src/features/settings/screens/SettingsScreen.tsx +++ b/src/features/settings/screens/SettingsScreen.tsx @@ -1,5 +1,5 @@ import { View, Text, Pressable } from "react-native"; -import { useSettings } from "../../providers/WatchProvider"; +import { useSettings } from "../../../providers/WatchProvider"; export function SettingsScreen() { const { poolLength, setPoolLength } = useSettings(); diff --git a/src/features/watch-connectivity/hooks/useSyncWorkout.ts b/src/features/watch-connectivity/hooks/useSyncWorkout.ts index 09c478f..13ddaf2 100644 --- a/src/features/watch-connectivity/hooks/useSyncWorkout.ts +++ b/src/features/watch-connectivity/hooks/useSyncWorkout.ts @@ -1,5 +1,5 @@ import { useState } from "react"; -import WatchConnectivity from "../../modules/watch-connectivity"; +import WatchConnectivity from "../../../modules/watch-connectivity"; import type { WorkoutSet } from "@types/workout"; type SyncResult = { status: string } | { error: string }; diff --git a/src/features/watch-connectivity/hooks/useWatchConnection.ts b/src/features/watch-connectivity/hooks/useWatchConnection.ts index 0b63095..3fe2e6b 100644 --- a/src/features/watch-connectivity/hooks/useWatchConnection.ts +++ b/src/features/watch-connectivity/hooks/useWatchConnection.ts @@ -1,5 +1,5 @@ import { useState, useEffect } from "react"; -import WatchConnectivity from "../../modules/watch-connectivity"; +import WatchConnectivity from "../../../modules/watch-connectivity"; type WatchConnectionStatus = "connected" | "disconnected" | "pending"; diff --git a/src/features/watch-connectivity/hooks/useWatchReachability.ts b/src/features/watch-connectivity/hooks/useWatchReachability.ts index 9a74e81..e89a6ea 100644 --- a/src/features/watch-connectivity/hooks/useWatchReachability.ts +++ b/src/features/watch-connectivity/hooks/useWatchReachability.ts @@ -1,5 +1,5 @@ import { useState, useEffect } from "react"; -import WatchConnectivity from "../../modules/watch-connectivity"; +import WatchConnectivity from "../../../modules/watch-connectivity"; export function useWatchReachability() { const [isReachable, setIsReachable] = useState(false); diff --git a/src/modules/watch-connectivity/index.ts b/src/modules/watch-connectivity/index.ts index 6384a88..1de3b42 100644 --- a/src/modules/watch-connectivity/index.ts +++ b/src/modules/watch-connectivity/index.ts @@ -1,3 +1,16 @@ -import { requireNativeModule } from "expo-modules-core"; +import { requireOptionalNativeModule } from "expo-modules-core"; -export default requireNativeModule("WatchConnectivity"); +let WatchConnectivity: any; + +WatchConnectivity = requireOptionalNativeModule("WatchConnectivity") ?? { + isSupported: async () => false, + isPaired: async () => false, + isWatchAppInstalled: async () => false, + isReachable: async () => false, + sendWorkoutPlan: async () => ({ error: "WatchConnectivity native module not available" }), + sendWorkoutCompletion: async () => ({ error: "WatchConnectivity native module not available" }), + getApplicationContext: async () => null, + updateApplicationContext: async () => {}, +}; + +export default WatchConnectivity; diff --git a/src/providers/WatchProvider.tsx b/src/providers/WatchProvider.tsx index 7cfc5b4..1db420b 100644 --- a/src/providers/WatchProvider.tsx +++ b/src/providers/WatchProvider.tsx @@ -1,7 +1,7 @@ import { createContext, useContext, useEffect, useState, type ReactNode } from "react"; -import { MMKV } from "react-native-mmkv"; +import { createMMKV } from "react-native-mmkv"; -const storage = new MMKV(); +const storage = createMMKV(); type SettingsContextType = { poolLength: number; diff --git a/targets/watch/ContentView.swift b/targets/watch/ContentView.swift index 024a84f..6398247 100644 --- a/targets/watch/ContentView.swift +++ b/targets/watch/ContentView.swift @@ -50,7 +50,7 @@ struct WorkoutListView: View { Text(workout.name ?? "Workout") .font(.headline) .foregroundColor(.primary) - Text("\(workout.totalDistance)m · \(workout.sets.count) sets") + Text("\(workout.sets.reduce(0) { $0 + $1.distancePerRep * $1.repCount })m · \(workout.sets.count) sets") .font(.caption) .foregroundColor(.secondary) } @@ -85,7 +85,7 @@ struct WorkoutListView: View { } } } - .listStyle(.grouped) + .listStyle(.automatic) .onAppear { workoutManager.loadSavedWorkouts() } diff --git a/tsconfig.json b/tsconfig.json index 1b67e75..a521dc9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,9 @@ "@hooks/*": ["./src/hooks/*"], "@utils/*": ["./src/utils/*"], "@constants/*": ["./src/constants/*"], - "@db/*": ["./src/db/*"] + "@db/*": ["./src/db/*"], + "@navigation/*": ["./src/navigation/*"], + "@types/*": ["./src/types/*"] } }, "include": ["**/*.ts", "**/*.tsx", "nativewind-env.d.ts"]