From 16fed2e7d00252f5df3f9b5bdf0a5a2b2a094f76 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 8 Aug 2023 10:39:34 +0700
Subject: Improve home page performance

---
 .../elements/Skeleton/TopBannerSkeleton.jsx           | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 src/core/components/elements/Skeleton/TopBannerSkeleton.jsx

(limited to 'src/core/components/elements/Skeleton/TopBannerSkeleton.jsx')

diff --git a/src/core/components/elements/Skeleton/TopBannerSkeleton.jsx b/src/core/components/elements/Skeleton/TopBannerSkeleton.jsx
new file mode 100644
index 00000000..f7d2e748
--- /dev/null
+++ b/src/core/components/elements/Skeleton/TopBannerSkeleton.jsx
@@ -0,0 +1,19 @@
+import useDevice from '@/core/hooks/useDevice'
+import classNames from 'classnames'
+import Skeleton from 'react-loading-skeleton'
+
+const TopBannerSkeleton = () => {
+  const { isDesktop, isMobile } = useDevice()
+
+  const deviceClassName = {
+    'h-10': isDesktop,
+    'h-2.5': isMobile
+  }
+  const combinedClassName = classNames(deviceClassName)
+
+  return (
+    <Skeleton className={combinedClassName} count={1} containerClassName='w-full h-full block' />
+  )
+}
+
+export { TopBannerSkeleton }
-- 
cgit v1.2.3

