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
11 changes: 6 additions & 5 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import SkeletonDashboard from "./components/SkeletonDashboard";
import { eventBus } from "./core/events";
import { useSWR } from "./hooks/useSWR";
import {
estimateExposureTime,
estimateWeeklyMonthlyAverages,
fetchAirQualityByCoords,
Expand Down Expand Up @@ -62,7 +63,7 @@
import Leaderboard from "./components/Leaderboard";
import SmartAlertsDashboard from "./components/SmartAlertsDashboard";
import NoisePollutionTracker from "./components/NoisePollutionTracker";
import OceanAcidificationMonitor from "./components/OceanAcidificationMonitor";
import OceanAcidificationMonitor from "./components/OceanAcidificationMonitor";

import HealthImpactDashboard from "./components/HealthImpactDashboard";

Expand Down Expand Up @@ -356,9 +357,9 @@
{ id: "eco-impact", label: "Eco Impact" },
{ id: "city-leaderboard", label: "City Leaderboard" },
{ id: "marine", label: "Marine Water Quality" },
{ id: "smart-alerts", label: "Smart Alerts" },
{ id: "smart-alerts", label: "Smart Alerts" },
{ id: "noise-pollution", label: "Noise Pollution" },
{ id: "ocean-acid", label: "Ocean Acidification" },
{ id: "ocean-acid", label: "Ocean Acidification" },

{ id: "smart-alerts", label: "Smart Alerts" },
{ id: "ocean-acid", label: "Ocean Acidification" },
Expand Down Expand Up @@ -612,7 +613,7 @@
} = useSWR(precomputedKey, () => getPrecomputedAverages(position.lat, position.lon));

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

Check warning on line 616 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 935) change on every render. To fix this, wrap the initialization of 'trend' in its own useMemo() Hook

Check warning on line 616 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 932) 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 @@ -735,7 +736,7 @@
};
mediaQuery.addEventListener("change", handleOsThemeChange);
return () => mediaQuery.removeEventListener("change", handleOsThemeChange);
}, []);

Check warning on line 739 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 @@ -943,7 +944,7 @@
if (prev === 'dark') return 'high-contrast';
return 'light';
});
}, []);

Check warning on line 947 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 @@ -981,7 +982,7 @@
return () => {
window.removeEventListener("online", handleOnline);
};
}, []);

Check warning on line 985 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 @@ -1279,9 +1280,9 @@
<MarineWaterQualitySuite />
</Suspense>
)}
{activeSection === "smart-alerts" && <SmartAlertsDashboard position={position} />}
{activeSection === "smart-alerts" && <SmartAlertsDashboard position={position} />}
{activeSection === "noise-pollution" && <NoisePollutionTracker />}
{activeSection === "ocean-acid" && <OceanAcidificationMonitor />}
{activeSection === "ocean-acid" && <OceanAcidificationMonitor />}

{activeSection === "health-impact" && <HealthImpactDashboard />}
{activeSection === "CarbonCalculator" && (
Expand Down
1 change: 0 additions & 1 deletion src/components/Leaderboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ export default function Leaderboard() {
}, [isAuthenticated, user, stats]);

const leaderboard = useMemo(() => getLeaderboardData(), [getLeaderboardData]);
const nextLevel = useMemo(() => nextTrustLevel(stats.points), [stats.points]);

const currentUserRank = useMemo(() => {
return leaderboard.findIndex(item => item.isCurrentUser) + 1;
Expand Down
2 changes: 1 addition & 1 deletion src/components/NoisePollutionTracker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@
{ZONES.map((z, i) => {
const active = selectedZone === z.id;
return (
<div key={i} style={{ ...st.zoneRow, borderColor: active ? z.color : "#2d1b4e", background: active ? `${z.color}10` : undefined, cursor: "pointer" }}

Check failure on line 428 in src/components/NoisePollutionTracker.jsx

View workflow job for this annotation

GitHub Actions / Lint

Avoid non-native interactive elements. If using native HTML is not possible, add an appropriate role and support for tabbing, mouse, keyboard, and touch inputs to an interactive content element

Check failure on line 428 in src/components/NoisePollutionTracker.jsx

View workflow job for this annotation

GitHub Actions / Lint

Visible, non-interactive elements with click handlers must have at least one keyboard listener
onClick={() => setSelectedZone(z.id)}>
<span style={{ fontSize: "1.3rem" }}>{z.icon}</span>
<div style={{ flex: 1 }}>
Expand Down Expand Up @@ -463,7 +463,7 @@
</div>
<div style={{ ...st.kpi, flex: 1 }}>
<div style={{ fontSize: "0.8rem", color: "#64748b", marginBottom: "4px" }}>Night Compliance</div>
<div style={{ fontSize: "2rem", fontWeight: 800, color={hourly.filter(h => (h.hour >= 22 || h.hour < 6) && h.db > zone.nightLimit).length === 0 ? "#22c55e" : "#ef4444"}>
<div style={{ fontSize: "2rem", fontWeight: 800, color: hourly.filter(h => (h.hour >= 22 || h.hour < 6) && h.db > zone.nightLimit).length === 0 ? "#22c55e" : "#ef4444" }}>
{Math.round(hourly.filter(h => (h.hour >= 22 || h.hour < 6) && h.db <= zone.nightLimit).length / hourly.filter(h => h.hour >= 22 || h.hour < 6).length * 100)}%
</div>
<div style={st.progressTrack}>
Expand Down
Loading