Skip to content

Commit 6269e01

Browse files
committed
feat: add BenchmarkScreen for performance testing
1 parent 94636c7 commit 6269e01

6 files changed

Lines changed: 444 additions & 12 deletions

File tree

bun.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/App.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { StatusBar } from "expo-status-bar";
22
import { useEffect, useState } from "react";
33
import { ActivityIndicator, Linking, StyleSheet, Text, TouchableOpacity, View } from "react-native";
44
import { getLatestVersion, getStoreUrl, needsUpdate, VersionCheck } from "react-native-nitro-version-check";
5+
import BenchmarkScreen from "./BenchmarkScreen";
56

67
export default function App() {
8+
const [screen, setScreen] = useState<"main" | "benchmark">("main");
79
const [loading, setLoading] = useState(true);
810
const [storeUrl, setStoreUrl] = useState<string | null>(null);
911
const [latestVersion, setLatestVersion] = useState<string | null>(null);
@@ -38,6 +40,10 @@ export default function App() {
3840
fetchAll();
3941
}, []);
4042

43+
if (screen === "benchmark") {
44+
return <BenchmarkScreen onBack={() => setScreen("main")} />;
45+
}
46+
4147
return (
4248
<View style={styles.container}>
4349
{/* Sync properties — available immediately */}
@@ -72,6 +78,12 @@ export default function App() {
7278
</>
7379
)}
7480

81+
<View style={styles.divider} />
82+
83+
<TouchableOpacity style={styles.benchmarkButton} onPress={() => setScreen("benchmark")}>
84+
<Text style={styles.benchmarkButtonText}>Run Benchmark</Text>
85+
</TouchableOpacity>
86+
7587
<StatusBar style="auto" />
7688
</View>
7789
);
@@ -114,4 +126,16 @@ const styles = StyleSheet.create({
114126
color: "#999",
115127
fontSize: 14,
116128
},
129+
benchmarkButton: {
130+
backgroundColor: "#007AFF",
131+
paddingVertical: 12,
132+
paddingHorizontal: 24,
133+
borderRadius: 10,
134+
marginTop: 8,
135+
},
136+
benchmarkButtonText: {
137+
color: "#fff",
138+
fontSize: 16,
139+
fontWeight: "600",
140+
},
117141
});

0 commit comments

Comments
 (0)