diff --git a/frontend/src/pages/HealthPage.jsx b/frontend/src/pages/HealthPage.jsx index 24fc86d..2efe67e 100644 --- a/frontend/src/pages/HealthPage.jsx +++ b/frontend/src/pages/HealthPage.jsx @@ -199,30 +199,6 @@ function ActivityRefLabel({ viewBox, icon }) { // *below* the battery bars (the negative Y region) so they don't obscure the data. const ACTIVITY_BAND_BOTTOM = -18 -function ActivityBands({ activities, nearestT, sportColor, sportIcon }) { - return (activities || []).map(a => { - const start = new Date(a.start_time).getTime() - const end = a.duration_s ? start + a.duration_s * 1000 : start - const x1 = nearestT(start), x2 = nearestT(end) - if (x1 == null || x2 == null) return null - const color = sportColor(a.sport_type) - return ( - } - /> - ) - }) -} - function BodyBatteryChart({ bb, hiresValues, sleepStart, sleepEnd, activities }) { if (!bb) return null const { charged, drained, start_level, end_level } = bb @@ -292,7 +268,18 @@ function BodyBatteryChart({ bb, hiresValues, sleepStart, sleepEnd, activities }) ))} - + {(activities || []).map(a => { + const start = new Date(a.start_time).getTime() + const end = a.duration_s ? start + a.duration_s * 1000 : start + const x1 = nearestT(start), x2 = nearestT(end) + if (x1 == null || x2 == null) return null + const color = sportColor(a.sport_type) + return ( + } /> + ) + })}