Skip to content

Commit

Permalink
chore: remove status page (#61)
Browse files Browse the repository at this point in the history
* chore: remove status page

* chore: remove status page

* chore: remove status page

* chore: remove status page

* chore: remove status page
  • Loading branch information
HenrySpartGlobal authored Feb 18, 2024
1 parent a7ed8ea commit 855e61b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 54 deletions.
5 changes: 0 additions & 5 deletions src/partials/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ export default function Footer(props: { withBorder?: boolean }) {
Donate
</a>
</li>
<li>
<a href="https://inhousequeue.statuspage.io/">
Status
</a>
</li>
<li>
<a href="https://docs.inhousequeue.xyz/">
Documentation
Expand Down
50 changes: 5 additions & 45 deletions src/partials/Home/StatCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,27 @@ import React from "react";

import StatCard from "../../components/StatCard/StatCard";

interface IStatsProps {
status: string;
last_check: string;
message: string;
server_count: number;
total_games: number;
total_users: number;
}

export default function StatCards() {
const [stats, setStats] = React.useState<IStatsProps | undefined>();

const fetchStats = async () => {
const header = {
"method": "GET",
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json"
};

try {
const res = await fetch("https://health.inhousequeue.xyz/health", { headers: header });
const data = await res.json() as IStatsProps; // Type assertion here
setStats(data);
} catch(err) {
console.log(err);
setStats({
status: "unoperational",
last_check: "",
message: "",
server_count: 700,
total_games: 10000,
total_users: 12000
})
}
};

React.useEffect(() => {
void fetchStats();
}, [])

// Directly use the hardcoded values in your JSX
return (
<div className="relative w-full z-30">
<div className="flex -translate-y-24 flex-row flex-wrap z-30 w-full align-middle justify-center gap-9">
<StatCard
count={stats?.server_count ?? 0}
count={2000}
label="Servers"
aosIndex={0}
/>

<StatCard
count={stats?.total_users ?? 0}
count={24000}
label="Active Players"
aosIndex={1}
/>

<StatCard
count={stats?.total_games ?? 0}
count={50000}
label="Matches Played"
aosIndex={2}
/>
</div>
</div>
)
);
}
4 changes: 0 additions & 4 deletions src/partials/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ const links = [
name: "GitHub",
href: "https://github.com/HenrySpartGlobal/InHouseQueue"
},
{
name: "Status",
href: "https://inhousequeue.statuspage.io/"
},
{
name: "Documentation",
href: "https://docs.inhousequeue.xyz"
Expand Down

0 comments on commit 855e61b

Please sign in to comment.