From 5607234f74b95afcbd96464dfce4439f27f1c990 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 27 Jul 2026 11:45:23 -0700 Subject: [PATCH] chore: Remove COVID-19 tracing example screens The api.covid19api.com endpoint these two screens depended on has been shut down and no longer resolves, so both the auto and manual tracing examples showed an indefinite loading spinner instead of demoing tracing. Global COVID-19 case counts are also no longer suitable demo content. Removes TrackerScreen and ManualTrackerScreen along with their navigator entries, route types, and the two entry points in the Debug tab. Co-authored-by: Cursor --- src/App.tsx | 4 - src/navigation.ts | 2 - src/screens/ListApp.tsx | 18 ---- src/screens/ManualTrackerScreen.tsx | 159 ---------------------------- src/screens/TrackerScreen.tsx | 129 ---------------------- 5 files changed, 312 deletions(-) delete mode 100644 src/screens/ManualTrackerScreen.tsx delete mode 100644 src/screens/TrackerScreen.tsx diff --git a/src/App.tsx b/src/App.tsx index c1cd7e1..ef3d066 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,8 +13,6 @@ import * as Sentry from '@sentry/react-native'; import HomeScreen from './screens/HomeScreen'; import ListApp from './screens/ListApp'; -import TrackerScreen from './screens/TrackerScreen'; -import ManualTrackerScreen from './screens/ManualTrackerScreen'; import PerformanceTimingScreen from './screens/PerformanceTimingScreen'; import EndToEndTestsScreen from './screens/EndToEndTestsScreen'; import ProductDetailScreen from './screens/ProductDetailScreen'; @@ -231,8 +229,6 @@ const DebugNavigator = () => { return ( - - { - { - props.navigation.navigate('Tracker'); - }}> - - Auto Tracing Example - - - - { - props.navigation.navigate('ManualTracker'); - }}> - - Manual Tracing Example - - - { // Navigate with a reset action just to test diff --git a/src/screens/ManualTrackerScreen.tsx b/src/screens/ManualTrackerScreen.tsx deleted file mode 100644 index 63b9472..0000000 --- a/src/screens/ManualTrackerScreen.tsx +++ /dev/null @@ -1,159 +0,0 @@ -import * as React from 'react'; -import {Button, View, StyleSheet, Text, ActivityIndicator} from 'react-native'; - -import * as Sentry from '@sentry/react-native'; -import {Span} from '@sentry/types'; - -/** - * An example of how to add a Sentry Transaction to a React component manually. - * So you can control all spans that belong to that one transaction. - * - * This screen calls an API to get the latest COVID-19 Data to display. We attach a span - * to the fetch call and track the time it takes for Promise to resolve. - */ -const TrackerScreen = () => { - const [cases, setCases] = React.useState<{ - TotalConfirmed: number; - TotalDeaths: number; - TotalRecovered: number; - } | null>(null); - - const rootSpan = React.useRef(undefined); - - React.useEffect(() => { - // Initialize the transaction for the screen. - rootSpan.current = Sentry.startSpanManual( - { - name: 'Tracker Screen (manual)', - op: 'navigation', - }, - (span: Span) => span, - ); - - return () => { - // Ending the span triggers sending the data to Sentry. - rootSpan.current?.end(); - rootSpan.current = undefined; - }; - }, []); - - const loadData = async () => { - setCases(null); - - // Create a child span for the API call. - await Sentry.startSpan( - { - op: 'http', - name: 'Fetch Covid19 data from API', - parentSpan: rootSpan.current, - }, - async (span: Span) => { - const response = await fetch('https://api.covid19api.com/summary', { - method: 'GET', - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', - }, - }); - const json = await response.json(); - const newCases = json.Global; - setCases(newCases); - - span.setAttribute('received_cases', Object.keys(newCases)); - }, - ); - }; - - React.useEffect(() => { - loadData(); - }, []); - - return ( - - - Global COVID19 Cases - - - {cases ? ( - <> - - - - - ) : ( - - )} - -