From 923605dc2677f0af9fe413158427ed018b7ada3e Mon Sep 17 00:00:00 2001 From: Ali Farooq Date: Thu, 23 May 2024 01:21:02 +0500 Subject: [PATCH] fix(www) Build error fixed --- apps/www/src/app/(marketing)/page.tsx | 3 -- .../src/components/marketing/announment.tsx | 6 --- apps/www/src/hooks/use-breakpoints.ts | 39 ------------------- 3 files changed, 48 deletions(-) delete mode 100644 apps/www/src/hooks/use-breakpoints.ts diff --git a/apps/www/src/app/(marketing)/page.tsx b/apps/www/src/app/(marketing)/page.tsx index 3180c93..ae9bc32 100644 --- a/apps/www/src/app/(marketing)/page.tsx +++ b/apps/www/src/app/(marketing)/page.tsx @@ -8,6 +8,3 @@ export default function HomePage() { ); } - -export const dynamic = "force-static"; -export const revalidate = 60 * 60; diff --git a/apps/www/src/components/marketing/announment.tsx b/apps/www/src/components/marketing/announment.tsx index 1c645f7..b7b0454 100644 --- a/apps/www/src/components/marketing/announment.tsx +++ b/apps/www/src/components/marketing/announment.tsx @@ -1,23 +1,17 @@ -"use client"; - import { Icons } from "@/components/icons"; import { badgeVariants } from "@/components/ui/badge"; import { BorderBeam } from "@/components/ui/border-beam"; import { siteUrls } from "@/config/urls"; -import { useBreakpoints } from "@/hooks/use-breakpoints"; import { cn } from "@/lib/utils"; import Link from "next/link"; export function Announcment() { - const breakpoint = useBreakpoints(); - return ( { - const searchBreakpoint = React.useCallback( - (breakpoints: { key: string; value: number }[]) => { - return breakpoints.find((x) => window.innerWidth < x.value)?.key; - }, - [], - ); - - const entries = React.useMemo(() => { - return Object.entries(breakpoints) - .sort((a, b) => a[1] - b[1]) - .map(([key, value]) => ({ key, value })); - }, []); - - const [breakpoint, setBreakpoint] = React.useState( - searchBreakpoint(entries), - ); - - React.useEffect(() => { - const onResize = () => { - setBreakpoint(searchBreakpoint(entries)); - }; - window.addEventListener("resize", onResize); - return () => { - window.removeEventListener("resize", onResize); - }; - }, [entries, searchBreakpoint]); - - return breakpoint; -};