add commas in member count (#286)

l
This commit is contained in:
Commandtechno 2022-12-03 16:11:08 -06:00 committed by GitHub
parent 4d8145f12c
commit c74241fde6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,11 +35,13 @@ function MemberCount() {
if (!c) return null; if (!c) return null;
let total = String(c[0]); let total = c[0].toLocaleString();
if (total === "0" && c[1] > 0) { if (total === "0" && c[1] > 0) {
total = "Loading..."; total = "Loading...";
} }
const online = c[1].toLocaleString();
return ( return (
<Flex id="vc-membercount" style={{ <Flex id="vc-membercount" style={{
marginTop: "1em", marginTop: "1em",
@ -49,7 +51,7 @@ function MemberCount() {
alignContent: "center", alignContent: "center",
gap: 0 gap: 0
}}> }}>
<Tooltip text={`${c[1]} Online`} position="bottom"> <Tooltip text={`${online} Online`} position="bottom">
{props => ( {props => (
<div {...props}> <div {...props}>
<span <span
@ -62,11 +64,11 @@ function MemberCount() {
marginRight: "0.5em" marginRight: "0.5em"
}} }}
/> />
<span style={{ color: "var(--status-green-600)" }}>{c[1]}</span> <span style={{ color: "var(--status-green-600)" }}>{online}</span>
</div> </div>
)} )}
</Tooltip> </Tooltip>
<Tooltip text={`${c[0] || "?"} Total Members`} position="bottom"> <Tooltip text={`${total} Total Members`} position="bottom">
{props => ( {props => (
<div {...props}> <div {...props}>
<span <span