diff --git a/client/src/App.js b/client/src/App.js index 9f48d30..652d5a4 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -781,12 +781,12 @@ function LivingRoomDust({end, duration}) { ); } -function LivingRoomAir({end, duration}) { - const [data, loading, tickFormatter] = useSensor('air', 'Living Room', end, duration); +function Air({name, sensorName, end, duration}) { + const [data, loading, tickFormatter] = useSensor('air', sensorName, end, duration); return ( x.max_p10?.toFixed(1) + ' ug/m³'} loading={loading} @@ -870,183 +870,7 @@ function LivingRoomAir({end, duration}) { ); } -function KitchenAir({end, duration}) { - const [data, loading, tickFormatter] = useSensor('air', 'Kitchen', end, duration); - return ( - x.max_p10?.toFixed(1) + ' ug/m³'} - loading={loading} - > - - - - - - - - v + units[name]} - labelFormatter={timeStr => moment(timeStr).tz('America/Edmonton').format('ddd MMM DD h:mm A')} - separator=': ' - /> - - - - - - - - - - - - ); -} - -function BedroomAir({end, duration}) { - const [data, loading, tickFormatter] = useSensor('air', 'Bedroom', end, duration); - - return ( - x.max_p10?.toFixed(1) + ' ug/m³'} - loading={loading} - > - - - - - - - - v + units[name]} - labelFormatter={timeStr => moment(timeStr).tz('America/Edmonton').format('ddd MMM DD h:mm A')} - separator=': ' - /> - - - - - - - - - - - - ); -} function BedroomSleep({end, duration}) { const [data, loading, tickFormatter] = useSensor('sleep', 'Bedroom', end, duration); @@ -1191,9 +1015,9 @@ function Graphs({end, duration}) {
- - - + + +