From fa4777732e7cd80ce1c8fd51afe7ecdc5a5f2662 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 5 Jun 2020 02:48:20 +0000 Subject: [PATCH] Add space activity chart to UI --- webclient/src/Charts.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/webclient/src/Charts.js b/webclient/src/Charts.js index cab4fcb..313a10a 100644 --- a/webclient/src/Charts.js +++ b/webclient/src/Charts.js @@ -7,10 +7,12 @@ import { NotFound } from './Misc.js'; let memberCountCache = false; let signupCountCache = false; +let spaceActivityCache = false; export function Charts(props) { const [memberCount, setMemberCount] = useState(memberCountCache); const [signupCount, setSignupCount] = useState(signupCountCache); + const [spaceActivity, setSpaceActivity] = useState(spaceActivityCache); useEffect(() => { requester('/charts/membercount/', 'GET') @@ -30,6 +32,15 @@ export function Charts(props) { .catch(err => { console.log(err); }); + + requester('/charts/spaceactivity/', 'GET') + .then(res => { + setSpaceActivity(res); + spaceActivityCache = res; + }) + .catch(err => { + console.log(err); + }); }, []); return ( @@ -79,6 +90,35 @@ export function Charts(props) {

The Green Count is the amount of Prepaid and Current members.

+
Space Activity
+ +

Daily since March 7th, 2020.

+ +

+ {spaceActivity && + + + + + + + + + + + + } +

+ +

Cards Scans is the number of individual members who have scanned to enter the space.

+
Signup Count

Monthly for the last sixteen months.