Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import SolutionsAwareness from "./components/SolutionsAwareness";
import ScenarioSimulator from "./components/ScenarioSimulator";
import HistoricalAnalysis from "./components/HistoricalAnalysis";
import HistoricalPollutionExplorer from "./components/HistoricalPollutionExplorer";
import Factoid from "./components/Factoid";
import HistoricalData from "./components/HistoricalData";
import LocationSearch from "./components/LocationSearch";
Expand Down Expand Up @@ -327,6 +328,7 @@
{ id: "exposure-tracker", label: "Exposure Score" },
{ id: "history", label: "History" },
{ id: "historical-data", label: "Data Explorer" },
{ id: "historical-explorer", label: "Pollution Explorer" },
{ id: "Commute", label: "Commute" },
{ id: "CarbonCalculator", label: "Carbon Calculator" },
{ id: "glossary", label: "Glossary" },
Expand Down Expand Up @@ -653,7 +655,7 @@
} = useSWR(windKey, () => fetchWindData(position.lat, position.lon));

const current = aqiData?.current;
const trend = aqiData?.trend || [];

Check warning on line 658 in src/App.jsx

View workflow job for this annotation

GitHub Actions / Lint

The 'trend' logical expression could make the dependencies of useMemo Hook (at line 972) change on every render. To fix this, wrap the initialization of 'trend' in its own useMemo() Hook

Check warning on line 658 in src/App.jsx

View workflow job for this annotation

GitHub Actions / Lint

The 'trend' logical expression could make the dependencies of useMemo Hook (at line 968) change on every render. To fix this, wrap the initialization of 'trend' in its own useMemo() Hook
const nearbyPoints = aqiData?.nearbyPoints || [];
const confidenceScore = aqiData?.confidenceScore || "High";
const dataCompleteness = aqiData?.dataCompleteness || 100;
Expand Down Expand Up @@ -776,7 +778,7 @@
};
mediaQuery.addEventListener("change", handleOsThemeChange);
return () => mediaQuery.removeEventListener("change", handleOsThemeChange);
}, []);

Check warning on line 781 in src/App.jsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'setTheme'. Either include it or remove the dependency array

const startGeolocation = useCallback(() => {
const requestId = ++geoRequestId.current;
Expand Down Expand Up @@ -979,7 +981,7 @@
if (prev === 'dark') return 'high-contrast';
return 'light';
});
}, []);

Check warning on line 984 in src/App.jsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useCallback has a missing dependency: 'setTheme'. Either include it or remove the dependency array

const acceptOsThemeSuggestion = () => {
// @ts-ignore
Expand Down Expand Up @@ -1016,7 +1018,7 @@
return () => {
window.removeEventListener("online", handleOnline);
};
}, []);

Check warning on line 1021 in src/App.jsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'refreshNow'. Either include it or remove the dependency array
useEffect(() => {
eventBus.on("TOGGLE_THEME", toggleTheme);
eventBus.on("FORCE_REFRESH", refreshNow);
Expand Down Expand Up @@ -1223,11 +1225,16 @@
<HistoricalAnalysis position={position} />
</div>
)}
{activeSection === "historical-data" && (
<div className="content-grid history-layout">
<HistoricalData position={position} />
</div>
)}
{activeSection === "historical-data" && (
<div className="content-grid history-layout">
<HistoricalData position={position} />
</div>
)}
{activeSection === "historical-explorer" && (
<div className="content-grid history-layout">
<HistoricalPollutionExplorer position={position} />
</div>
)}

{activeSection === "quiz" && (
<div className="content-grid quiz-layout">
Expand Down Expand Up @@ -1358,4 +1365,4 @@
</ErrorBoundary>
</ThemeProvider>
);
}
}
Loading
Loading