fix build warnings
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m23s

Took 12 minutes
This commit is contained in:
Braydon 2024-10-09 17:29:43 -04:00
parent 6e949539ab
commit 3d44677d82
6 changed files with 18 additions and 9 deletions

View File

@ -26,10 +26,10 @@ export type Config = {
/** /**
* Social links for this app. * Social links for this app.
*/ */
socialLinks: SocialLink[]; socialLinks: SocialLinkType[];
}; };
type SocialLink = { export type SocialLinkType = {
/** /**
* The name of this social link. * The name of this social link.
*/ */

View File

@ -8,6 +8,7 @@ import { cn } from "@/lib/utils";
import { ExternalLink } from "lucide-react"; import { ExternalLink } from "lucide-react";
import SocialLink from "@/components/social-link"; import SocialLink from "@/components/social-link";
import config from "@/config"; import config from "@/config";
import { SocialLinkType } from "@/types/config";
const links = { const links = {
Resources: [ Resources: [
@ -56,7 +57,7 @@ const Footer = (): ReactElement => (
{/* Socials */} {/* Socials */}
<div className="pl-1 flex gap-2.5 items-center z-50"> <div className="pl-1 flex gap-2.5 items-center z-50">
{config.socialLinks.map((link: SocialLink) => ( {config.socialLinks.map((link: SocialLinkType) => (
<SocialLink <SocialLink
key={link.name} key={link.name}
className="w-5 h-5" className="w-5 h-5"

View File

@ -13,6 +13,7 @@ import {
import Link from "next/link"; import Link from "next/link";
import { capitalizeWords } from "@/lib/string"; import { capitalizeWords } from "@/lib/string";
import ImageViewer from "@/components/image-viewer"; import ImageViewer from "@/components/image-viewer";
import Image from "next/image";
const blockquoteStyles: { [key: string]: any } = { const blockquoteStyles: { [key: string]: any } = {
NOTE: { NOTE: {
@ -96,10 +97,13 @@ const components = {
// Media // Media
img: ({ src, alt }: { src: string; alt: string }): ReactElement => ( img: ({ src, alt }: { src: string; alt: string }): ReactElement => (
<ImageViewer className="m-2 my-2.5"> <ImageViewer className="m-2 my-2.5">
<img <Image
className="ring-1 ring-muted/45 rounded-2xl select-none" className="ring-1 ring-muted/45 rounded-2xl select-none"
src={src} src={src}
alt={alt} alt={alt}
width={1920}
height={1080}
unoptimized
draggable={false} draggable={false}
/> />
</ImageViewer> </ImageViewer>

View File

@ -7,6 +7,7 @@ import QuickSearchDialog from "@/components/navbar/search-dialog";
import Sidebar from "@/components/sidebar/sidebar"; import Sidebar from "@/components/sidebar/sidebar";
import SocialLink from "@/components/social-link"; import SocialLink from "@/components/social-link";
import config from "@/config"; import config from "@/config";
import { SocialLinkType } from "@/types/config";
const Navbar = ({ pages }: { pages: DocsContentMetadata[] }): ReactElement => ( const Navbar = ({ pages }: { pages: DocsContentMetadata[] }): ReactElement => (
<nav className="fixed left-0 inset-x-0 bg-white/95 dark:bg-white/[0.007] backdrop-saturate-100 backdrop-blur-xl border-b z-50"> <nav className="fixed left-0 inset-x-0 bg-white/95 dark:bg-white/[0.007] backdrop-saturate-100 backdrop-blur-xl border-b z-50">
@ -37,8 +38,8 @@ const Navbar = ({ pages }: { pages: DocsContentMetadata[] }): ReactElement => (
{/* Social */} {/* Social */}
<div className="flex gap-5 items-center"> <div className="flex gap-5 items-center">
{config.socialLinks {config.socialLinks
.filter((link: SocialLink) => link.navbar) .filter((link: SocialLinkType) => link.navbar)
.map((link: SocialLink) => ( .map((link: SocialLinkType) => (
<SocialLink key={link.name} {...link} /> <SocialLink key={link.name} {...link} />
))} ))}
</div> </div>

View File

@ -4,8 +4,9 @@ import Image from "next/image";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import Icon from "@/components/ui/icon"; import Icon from "@/components/ui/icon";
import { icons } from "lucide-react"; import { icons } from "lucide-react";
import { SocialLinkType } from "@/types/config";
type SocialLinkProps = SocialLink & { type SocialLinkProps = SocialLinkType & {
className?: string | undefined; className?: string | undefined;
}; };

View File

@ -83,14 +83,16 @@ export function GridPattern({
}); });
} }
}); });
let current = undefined;
if (containerRef.current) { if (containerRef.current) {
resizeObserver.observe(containerRef.current); resizeObserver.observe(containerRef.current);
current = containerRef.current;
} }
return () => { return () => {
if (containerRef.current) { if (current) {
resizeObserver.unobserve(containerRef.current); resizeObserver.unobserve(current);
} }
}; };
}, [containerRef]); }, [containerRef]);