UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
🚨 lint: Fix build
Dillion Vermaa3a219c55387
diff --git a/app/api/og/route.tsx b/app/api/og/route.tsxindex c29c2f16..f0b3bb21 100644--- a/app/api/og/route.tsx+++ b/app/api/og/route.tsx@@ -2,8 +2,6 @@ import { capitalize } from "@/lib/utils";import { ImageResponse } from "next/server";export const runtime = "edge";-export const alt = "Magic UI";-export const contentType = "image/png";const interSemiBold = fetch(new URL("../../../assets/fonts/Inter-SemiBold.ttf", import.meta.url)@@ -34,8 +32,11 @@ export async function GET(req: Request) {height: "100%",}}>+ {/* @ts-ignore */}<img+ // @ts-ignoresrc={imageData}+ alt={title}style={{position: "absolute",inset: 0,diff --git a/app/components/[slug]/opengraph-image.tsx b/app/components/[slug]/opengraph-image.tsxnew file mode 100644index 00000000..59a9c73c--- /dev/null+++ b/app/components/[slug]/opengraph-image.tsx@@ -0,0 +1,2 @@+export const alt = "Magic UI Component";+export const contentType = "image/png";diff --git a/app/components/[slug]/twitter-image.tsx b/app/components/[slug]/twitter-image.tsxnew file mode 100644index 00000000..59a9c73c--- /dev/null+++ b/app/components/[slug]/twitter-image.tsx@@ -0,0 +1,2 @@+export const alt = "Magic UI Component";+export const contentType = "image/png";diff --git a/app/components/page.tsx b/app/components/page.tsxindex 0e67f9b8..01e50ea1 100644--- a/app/components/page.tsx+++ b/app/components/page.tsx@@ -19,8 +19,6 @@ export default async function ComponentPage() {return compareDesc(new Date(a.date), new Date(b.date));});- console.log(posts.map((p) => p.title));-return (<div className="container max-w-4xl py-6 lg:py-10"><div className="flex flex-col items-start gap-4 md:flex-row md:justify-between md:gap-8">diff --git a/app/templates/page.tsx b/app/templates/page.tsxindex 9f3b6c43..65cbce13 100644--- a/app/templates/page.tsx+++ b/app/templates/page.tsx@@ -1,3 +1,4 @@+import { Component } from "@/.contentlayer/generated";import { FadeIn } from "@/components/magicui/FadeIn";import { constructMetadata } from "@/lib/utils";import Link from "next/link";@@ -9,7 +10,7 @@ export const metadata = constructMetadata({});export default async function TemplatePage() {- const posts = [];+ const posts: Component[] = [];return (<div className="container max-w-4xl py-6 lg:py-10">diff --git a/components/MDX.tsx b/components/MDX.tsxindex ad87612f..82a92d35 100644--- a/components/MDX.tsx+++ b/components/MDX.tsx@@ -1,6 +1,5 @@"use client";-import Hello from "@/components/hello";import { cn } from "@/lib/utils";import { useMDXComponent } from "next-contentlayer/hooks";import Image from "next/image";@@ -48,13 +47,13 @@ const components = {pre: ({className,__rawString__,- __npmCommand__,- __pnpmCommand__,- __yarnCommand__,+ // __npmCommand__,+ // __pnpmCommand__,+ // __yarnCommand__,__withMeta__,__src__,- __event__,- __style__,+ // __event__,+ // __style__,...props}: React.HTMLAttributes<HTMLPreElement> & {// __style__?: Style["name"]@@ -76,7 +75,7 @@ const components = {<CopyButtonvalue={__rawString__}src={__src__}- event={__event__}+ // event={__event__}className={cn("absolute right-4 top-4", __withMeta__ && "top-16")}/>)}@@ -112,13 +111,8 @@ export function MDX({ code }: MDXProps) {`prose-pre:mb-4 prose-pre:mt-6 prose-pre:max-h-[650px] prose-pre:overflow-x-auto prose-pre:rounded-lg prose-pre:border prose-pre:bg-gray-900 prose-pre:py-4 prose-pre:dark:bg-gray-900 prose-pre:px-0 prose-pre:text-sm prose-pre:tracking-tighter`)}>- <Component- components={{- ...components,- Hello,- // , MDXImage, MDXTweet, MDXRepo- }}- />+ {/* @ts-ignore */}+ <Component components={components} /></article>);}diff --git a/components/magicui/magic-border.tsx b/components/magicui/magic-border.tsxindex ed3d09c2..20e85b33 100644--- a/components/magicui/magic-border.tsx+++ b/components/magicui/magic-border.tsx@@ -41,30 +41,6 @@ export const MagicBorderContainer = ({const containerSize = useRef<{ w: number; h: number }>({ w: 0, h: 0 });const [boxes, setBoxes] = useState<Array<HTMLElement>>([]);- useEffect(() => {- containerRef.current &&- setBoxes(- Array.from(containerRef.current.children).map((el) => el as HTMLElement)- );- }, []);-- useEffect(() => {- init();- window.addEventListener("resize", init);-- return () => {- window.removeEventListener("resize", init);- };- }, [setBoxes]);-- useEffect(() => {- onMouseMove();- }, [mousePosition]);-- useEffect(() => {- init();- }, []);-const init = () => {if (containerRef.current) {containerSize.current.w = containerRef.current.offsetWidth;@@ -99,6 +75,30 @@ export const MagicBorderContainer = ({}};+ useEffect(() => {+ containerRef.current &&+ setBoxes(+ Array.from(containerRef.current.children).map((el) => el as HTMLElement)+ );+ }, []);++ useEffect(() => {+ init();+ window.addEventListener("resize", init);++ return () => {+ window.removeEventListener("resize", init);+ };+ }, [setBoxes]);++ useEffect(() => {+ onMouseMove();+ }, [mousePosition]);++ useEffect(() => {+ init();+ }, []);+return (<div className={className} ref={containerRef}>{children}diff --git a/components/main-nav.tsx b/components/main-nav.tsxindex d8651652..958cf796 100644--- a/components/main-nav.tsx+++ b/components/main-nav.tsx@@ -22,10 +22,10 @@ export function MainNav() {{docsConfig.mainNav.map((item) => (<Linkkey={item.href}- href={item.href}+ href={item.href!}className={cn("transition-colors hover:text-foreground/80",- pathname?.startsWith(item.href)+ pathname?.startsWith(item.href!)? "text-foreground": "text-foreground/60")}diff --git a/content/components/animated-text.mdx b/content/components/animated-text.mdxindex c745dc01..37178ab0 100644--- a/content/components/animated-text.mdx+++ b/content/components/animated-text.mdx@@ -18,8 +18,6 @@ Checkout my React component:{/* <Hello /> */}-<Hello />-{/* <Image src="/next.svg" width="718" height="404" alt="Image" /> */}```tsx showLineNumbers title="app/payments/columns.tsx" {3,14-27}