From a70fd5b6d9c7a769ac1aaa22a7d037ba3be27a05 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 16 Jan 2024 16:08:43 +0700
Subject: Update improve product detail performance

---
 src/pages/_app.jsx | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

(limited to 'src/pages/_app.jsx')

diff --git a/src/pages/_app.jsx b/src/pages/_app.jsx
index aa545863..9067fd03 100644
--- a/src/pages/_app.jsx
+++ b/src/pages/_app.jsx
@@ -1,6 +1,6 @@
 import '@/fonts/Inter/inter.css';
 import '@/styles/globals.css';
-import 'react-loading-skeleton/dist/skeleton.css';
+// import 'react-loading-skeleton/dist/skeleton.css';
 
 import { useEffect, useState } from 'react';
 import dynamic from 'next/dynamic';
@@ -9,8 +9,6 @@ import { AnimatePresence, motion } from 'framer-motion';
 import { QueryClient, QueryClientProvider } from 'react-query';
 
 import useDevice from '@/core/hooks/useDevice';
-import { ProductProvider } from '@/contexts/ProductContext';
-import { ProductCartProvider } from '@/contexts/ProductCartContext';
 import theme from '../../chakra.theme';
 
 const NextProgress = dynamic(() => import('next-progress'), { ssr: false });
@@ -18,6 +16,17 @@ const ChakraProvider = dynamic(
   () => import('@chakra-ui/react').then((mod) => mod.ChakraProvider),
   { ssr: false }
 );
+const ProductProvider = dynamic(
+  () => import('@/contexts/ProductContext').then((mod) => mod.ProductProvider),
+  { ssr: false }
+);
+const ProductCartProvider = dynamic(
+  () =>
+    import('@/contexts/ProductCartContext').then(
+      (mod) => mod.ProductCartProvider
+    ),
+  { ssr: false }
+);
 const SessionProvider = dynamic(
   () => import('next-auth/react').then((mod) => mod.SessionProvider),
   { ssr: false }
-- 
cgit v1.2.3

