Fix UI bugs

This commit is contained in:
Tanner Collin 2020-06-22 20:51:04 +00:00
parent 74e0bc9754
commit 5a2c022dfd
2 changed files with 3 additions and 2 deletions

View File

@ -20,7 +20,7 @@
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript style="background: white">You need to enable JavaScript to run this app.</noscript>
<div id="root"></div> <div id="root"></div>
<!-- <!--
This HTML file is a template. This HTML file is a template.

View File

@ -145,6 +145,7 @@ export function Home(props) {
}, [refreshCount]); }, [refreshCount]);
const getStat = (x) => stats && stats[x] ? stats[x] : '?'; const getStat = (x) => stats && stats[x] ? stats[x] : '?';
const getZeroStat = (x) => stats && stats[x] ? stats[x] : '0';
const getDateStat = (x) => stats && stats[x] ? moment.utc(stats[x]).tz('America/Edmonton').format('ll') : '?'; const getDateStat = (x) => stats && stats[x] ? moment.utc(stats[x]).tz('America/Edmonton').format('ll') : '?';
const mcPlayers = stats && stats['minecraft_players'] ? stats['minecraft_players'] : []; const mcPlayers = stats && stats['minecraft_players'] ? stats['minecraft_players'] : [];
@ -197,7 +198,7 @@ export function Home(props) {
<p>Member count: {getStat('member_count')} <Link to='/charts'>[more]</Link></p> <p>Member count: {getStat('member_count')} <Link to='/charts'>[more]</Link></p>
<p>Green members: {getStat('green_count')}</p> <p>Green members: {getStat('green_count')}</p>
<p>Old members: {getStat('paused_count')}</p> <p>Old members: {getStat('paused_count')}</p>
<p>Card scans today: {getStat('card_scans')}</p> <p>Card scans today: {getZeroStat('card_scans')}</p>
<p> <p>
Minecraft players: {mcPlayers.length} <Popup content={ Minecraft players: {mcPlayers.length} <Popup content={