Skip to content

Commit

Permalink
Reactor container props to be cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaFox161 committed Jan 25, 2025
1 parent 95015d7 commit 3ad12af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
4 changes: 2 additions & 2 deletions components/container.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {Props} from "../lib/types";
import {ReactNode} from "react";

export default function Container(props: Props) {
export default function Container(props: {children?: ReactNode}) {
return <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-10">
{props.children}
</div>
Expand Down
13 changes: 0 additions & 13 deletions lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
import {ReactNode} from "react"

/////////* Props */////////
export type Props = {
children?: ReactNode
extraClass?: string
caption?: string
}

export type NetworkProps = {
data: NetworkStatus,
}

/////////* Session Objects */////////
export type User = {
id: string,
Expand Down
8 changes: 4 additions & 4 deletions pages/status.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {JSX, useEffect, useState} from "react";
import Loader from "../components/loader";
import {toast} from "react-toastify";
import type {NetworkProps, NetworkStatus} from "../lib/types";
import type { NetworkStatus} from "../lib/types";
import Custom500 from "./500";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faRobot} from "@fortawesome/free-solid-svg-icons"
Expand Down Expand Up @@ -45,7 +45,7 @@ export default function StatusPage() {
</>
}

function GeneralStats(props: NetworkProps): JSX.Element {
function GeneralStats(props: {data: NetworkStatus}): JSX.Element {
const stats = [
{name: 'Guilds', stat: props.data.total_guilds},
{name: 'Calendars', stat: props.data.total_calendars},
Expand Down Expand Up @@ -83,7 +83,7 @@ function GeneralStats(props: NetworkProps): JSX.Element {
</div>
}

function ServiceStats(props: NetworkProps): JSX.Element {
function ServiceStats(props: {data: NetworkStatus}): JSX.Element {
const services = [
// Since there's only 1 API server, we can just statically add it to this list
{
Expand Down Expand Up @@ -150,7 +150,7 @@ function ServiceStats(props: NetworkProps): JSX.Element {
</div>
}

function ShardStats(props: NetworkProps): JSX.Element {
function ShardStats(props: {data: NetworkStatus}): JSX.Element {
function listAll(): any[] {
let array: any[] = [];

Expand Down

0 comments on commit 3ad12af

Please sign in to comment.