diff --git a/app/_ui/ActivityFeedClient.tsx b/app/_ui/ActivityFeedClient.tsx new file mode 100644 index 0000000..525fca9 --- /dev/null +++ b/app/_ui/ActivityFeedClient.tsx @@ -0,0 +1,31 @@ +"use client"; + +import React, { useEffect, useState } from "react"; + +type ActivityFeedComponent = React.ComponentType>; + +export default function ActivityFeedClient() { + const [Comp, setComp] = useState(null); + + useEffect(() => { + let cancelled = false; + (async () => { + try { + const mod = await import("../components/ActivityFeed"); + const C = (mod as unknown as { default?: ActivityFeedComponent }).default; + if (!cancelled && typeof C === "function") { + setComp(() => C); + } + } catch { + // ignore + } + })(); + return () => { + cancelled = true; + }; + }, []); + + if (!Comp) return null; + return ; +} + diff --git a/app/_ui/HomePage.tsx b/app/_ui/HomePage.tsx index 55b28ba..26dc333 100644 --- a/app/_ui/HomePage.tsx +++ b/app/_ui/HomePage.tsx @@ -1,5 +1,3 @@ -"use client"; - import Header from "../components/Header"; import Hero from "../components/Hero"; import About from "../components/About"; @@ -7,19 +5,7 @@ import Projects from "../components/Projects"; import Contact from "../components/Contact"; import Footer from "../components/Footer"; import Script from "next/script"; -import dynamic from "next/dynamic"; -import ErrorBoundary from "@/components/ErrorBoundary"; -import { motion } from "framer-motion"; - -// Wrap ActivityFeed in error boundary to prevent crashes -const ActivityFeed = dynamic( - () => - import("../components/ActivityFeed").catch(() => ({ default: () => null })), - { - ssr: false, - loading: () => null, - }, -); +import ActivityFeedClient from "./ActivityFeedClient"; export default function HomePage() { return ( @@ -46,9 +32,7 @@ export default function HomePage() { }), }} /> - - - +
{/* Spacer to prevent navbar overlap */} @@ -62,14 +46,9 @@ export default function HomePage() { viewBox="0 0 1440 120" preserveAspectRatio="none" > - @@ -90,14 +69,9 @@ export default function HomePage() { viewBox="0 0 1440 120" preserveAspectRatio="none" > - @@ -118,14 +92,9 @@ export default function HomePage() { viewBox="0 0 1440 120" preserveAspectRatio="none" > -