From 0f124e66f23d8925af91d574740f8513dd343dd6 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Mon, 16 Nov 2020 19:03:26 -0500 Subject: Move data into MainPage --- src/MainPage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/MainPage.js') diff --git a/src/MainPage.js b/src/MainPage.js index 7c316c4..7dd0cc9 100644 --- a/src/MainPage.js +++ b/src/MainPage.js @@ -3,8 +3,9 @@ import Card from "./Card"; import GoatCounter from "./GoatCounter"; const MainPage = (props) => { - const latest = props.latest; - const prior = props.prior; + const data = props.data; + const latest = data[data.length - 1]; + const prior = data[data.length - (1 + props.timeDifference)]; return ( <> -- cgit v1.2.3