Lazy load notification and keep-online providers
Introduced NotificationProviderWrapper to dynamically load the notification context only on dashboard pages, reducing initial bundle size. KeepOnline component is now also lazy-loaded. Updated app layout to use the new wrapper.
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import { usePathname } from "next/navigation";
|
||||
import KeepOnline from "@/components/KeepOnline";
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
// Lazy load KeepOnline component - only needed on dashboard pages
|
||||
const KeepOnline = dynamic(() => import("@/components/KeepOnline"), {
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
const KeepOnlineWrapper = () => {
|
||||
const pathname = usePathname();
|
||||
|
||||
Reference in New Issue
Block a user