From eb7e0012704d574d0d559229372a93fa4afbbaa4 Mon Sep 17 00:00:00 2001 From: Joseph Hale Date: Sat, 7 Jun 2025 19:38:04 -0700 Subject: [PATCH] perf: Remove multiple native dependencies Removes the need for React Navigation by making the settings accessible by tapping the clock (which should be easier to find than a long press). Additionally, removes the need for a dedicated save button -- preferring instead to auto save each setting. And, the section of the screen rendering the clock now contains the appropriate onLayout handling to automatically compute whether the clock should render in portrait or landscape mode. --- App.tsx | 35 +-- ios/BinaryClock.xcodeproj/project.pbxproj | 18 +- ios/Podfile.lock | 119 --------- package-lock.json | 287 +-------------------- package.json | 7 +- src/components/settings/SettingBoolean.tsx | 19 +- src/components/settings/SettingItem.tsx | 5 +- src/components/settings/SettingRange.tsx | 6 +- src/pages/BinaryClockScreen.tsx | 167 +++++++++--- src/pages/BinaryClockSettingsScreen.tsx | 122 --------- src/utils/BinaryClockSettings.ts | 10 +- 11 files changed, 179 insertions(+), 616 deletions(-) delete mode 100644 src/pages/BinaryClockSettingsScreen.tsx diff --git a/App.tsx b/App.tsx index 84300af..6cf58d6 100644 --- a/App.tsx +++ b/App.tsx @@ -5,36 +5,17 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. import BinaryClockScreen from './src/pages/BinaryClockScreen'; -import BinaryClockSettingsScreen from './src/pages/BinaryClockSettingsScreen'; -import {NavigationContainer} from '@react-navigation/native'; +import KeepAwake from '@sayem314/react-native-keep-awake'; import React from 'react'; -import Toast from 'react-native-toast-message'; -import {createNativeStackNavigator} from '@react-navigation/native-stack'; +import { StatusBar } from 'react-native'; -const Stack = createNativeStackNavigator(); - -const App = () => { +const App = () => { return ( - - - - - - - + <> +