warning fixes

This commit is contained in:
Braydon 2024-04-17 19:14:10 -04:00
parent 6790083006
commit 0610a6acfa
9 changed files with 81 additions and 71 deletions

@ -1,6 +1,7 @@
import FeaturedContent from "@/components/landing/featured-content"; import FeaturedContent from "@/components/landing/featured-content";
import Hero from "@/components/landing/hero"; import Hero from "@/components/landing/hero";
import StatisticCounters from "@/components/landing/statistic-counters"; import StatisticCounters from "@/components/landing/statistic-counters";
import { ReactElement } from "react";
/** /**
* The landing page. * The landing page.

@ -114,7 +114,7 @@ export const generateMetadata = async ({
const trimQuery = (query: string | undefined): string | undefined => { const trimQuery = (query: string | undefined): string | undefined => {
// Limit the query to 36 chars // Limit the query to 36 chars
if (query && query.length > 36) { if (query && query.length > 36) {
query = query.substr(0, 36); query = query.substring(0, 36);
} }
return query; return query;
}; };

@ -1,5 +1,8 @@
import { Metadata } from "next"; import { Metadata } from "next";
/**
* Props for an embed.
*/
type EmbedProps = { type EmbedProps = {
/** /**
* The title of the embed. * The title of the embed.

@ -2,8 +2,14 @@ import MinecraftButton from "@/components/minecraft-button";
import { Skeleton } from "@/components/ui/skeleton"; import { Skeleton } from "@/components/ui/skeleton";
import { StarIcon } from "@heroicons/react/24/outline"; import { StarIcon } from "@heroicons/react/24/outline";
import Link from "next/link"; import Link from "next/link";
import { Suspense } from "react"; import { ReactElement, Suspense } from "react";
/**
* The button to display the amount
* of stars the GitHub repository has.
*
* @returns the component jsx
*/
const GitHubStarButton = async (): Promise<ReactElement> => { const GitHubStarButton = async (): Promise<ReactElement> => {
return ( return (
<Link <Link
@ -35,7 +41,7 @@ const GitHubStarButton = async (): Promise<ReactElement> => {
* *
* @returns the star count jsx * @returns the star count jsx
*/ */
const GitHubStarCount = async (): Promise<JSX.Element> => { const GitHubStarCount = async (): Promise<ReactElement> => {
const stars: number = await getStarCount(); // Get the repo star count const stars: number = await getStarCount(); // Get the repo star count
return ( return (
<code className="px-1 rounded-md bg-minecraft-green-3/80">{stars}</code> <code className="px-1 rounded-md bg-minecraft-green-3/80">{stars}</code>

@ -1,5 +1,6 @@
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { ButtonHTMLAttributes, ReactElement, ReactNode } from "react";
/** /**
* Props for this button. * Props for this button.
@ -13,7 +14,7 @@ type MinecraftButtonProps = {
/** /**
* The children of this button. * The children of this button.
*/ */
children: React.ReactNode; children: ReactNode;
}; };
/** /**
@ -25,8 +26,8 @@ const MinecraftButton = ({
className, className,
children, children,
...props ...props
}: React.ButtonHTMLAttributes<HTMLButtonElement> & }: ButtonHTMLAttributes<HTMLButtonElement> &
MinecraftButtonProps): JSX.Element => ( MinecraftButtonProps): ReactElement => (
<Button <Button
className={cn( className={cn(
"before:absolute before:-inset-x-5 before:rotate-90 before:w-9 before:h-1 before:bg-minecraft-green-1", // Left Green Bar "before:absolute before:-inset-x-5 before:rotate-90 before:w-9 before:h-1 before:bg-minecraft-green-1", // Left Green Bar

@ -3,6 +3,7 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import { ReactElement } from "react";
/** /**
* A component for searching for a player. * A component for searching for a player.
@ -15,7 +16,7 @@ const PlayerSearch = ({
}: { }: {
query: string | undefined; query: string | undefined;
}): ReactElement => { }): ReactElement => {
const handleRedirect = async (form: FormData) => { const handleRedirect = async (form: FormData): Promise<void> => {
"use server"; "use server";
redirect(`/player/${form.get("query")}`); redirect(`/player/${form.get("query")}`);
}; };

@ -1,7 +1,5 @@
import { Config } from "@/types/config";
/** /**
* The configuration for this app. * The configuration for this app.
*/ */
const config: Config = require("@/configJson"); import config from "@/configJson";
export default config; export default config;

@ -8,7 +8,7 @@ import ThemeProvider from "@/provider/theme-provider";
import type { Metadata, Viewport } from "next"; import type { Metadata, Viewport } from "next";
import PlausibleProvider from "next-plausible"; import PlausibleProvider from "next-plausible";
import "./globals.css"; import "./globals.css";
import { ReactElement } from "react"; import { ReactElement, ReactNode } from "react";
/** /**
* Site metadata & viewport. * Site metadata & viewport.
@ -25,7 +25,7 @@ export const viewport: Viewport = config.viewport;
const RootLayout = ({ const RootLayout = ({
children, children,
}: Readonly<{ }: Readonly<{
children: React.ReactNode; children: ReactNode;
}>): ReactElement => { }>): ReactElement => {
const analyticsDomain: string | undefined = config.analyticsDomain; const analyticsDomain: string | undefined = config.analyticsDomain;
return ( return (

@ -1,6 +1,6 @@
import { clsx, type ClassValue } from "clsx"; import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]): string {
return twMerge(clsx(inputs)); return twMerge(clsx(inputs));
} }