From 5933732a74ae1ca4124ddd4e8265b1f443234736 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 21 Feb 2023 21:51:51 +0700
Subject: fix

---
 src/lib/wishlist/components/Wishlists.jsx | 41 +++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 src/lib/wishlist/components/Wishlists.jsx

(limited to 'src/lib/wishlist/components/Wishlists.jsx')

diff --git a/src/lib/wishlist/components/Wishlists.jsx b/src/lib/wishlist/components/Wishlists.jsx
new file mode 100644
index 00000000..8a456a8d
--- /dev/null
+++ b/src/lib/wishlist/components/Wishlists.jsx
@@ -0,0 +1,41 @@
+import Alert from "@/core/components/elements/Alert/Alert"
+import Pagination from "@/core/components/elements/Pagination/Pagination"
+import Spinner from "@/core/components/elements/Spinner/Spinner"
+import ProductCard from "@/lib/product/components/ProductCard"
+import { useRouter } from "next/router"
+import useWishlists from "../hooks/useWishlists"
+
+const Wishlists = () => {
+  const router = useRouter()
+  const {
+    page = 1
+  } = router.query
+  const limit = 30
+  const { wishlists } = useWishlists({ page, limit })
+
+  const pageCount = Math.ceil(wishlists.data?.productTotal / limit)
+
+  return (
+    <div className="px-4 py-6">
+      { wishlists.isLoading && (
+        <Spinner className="w-6 h-6 text-gray-600 fill-gray-900 mx-auto" />
+      ) }
+      { wishlists.data?.products?.length == 0 && (
+        <Alert type='info' className='text-center'>
+          Wishlist anda masih kosong
+        </Alert>
+      ) }
+      <div className="grid grid-cols-2 gap-3">
+        {wishlists.data?.products.map((product) => (
+          <ProductCard key={product.id} data={product} />
+        ))}
+      </div>
+
+      <div className="mt-6">
+        <Pagination currentPage={page} pageCount={pageCount} url={`/my/wishlist`} />
+      </div>
+    </div>
+  )
+}
+
+export default Wishlists
\ No newline at end of file
-- 
cgit v1.2.3


From 98c8fc56db91664b98a50e9113787b56fe785b9e Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 21 Feb 2023 22:33:32 +0700
Subject: fix

---
 src/lib/wishlist/components/Wishlists.jsx | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to 'src/lib/wishlist/components/Wishlists.jsx')

diff --git a/src/lib/wishlist/components/Wishlists.jsx b/src/lib/wishlist/components/Wishlists.jsx
index 8a456a8d..4bb63933 100644
--- a/src/lib/wishlist/components/Wishlists.jsx
+++ b/src/lib/wishlist/components/Wishlists.jsx
@@ -15,16 +15,22 @@ const Wishlists = () => {
 
   const pageCount = Math.ceil(wishlists.data?.productTotal / limit)
 
+  if (wishlists.isLoading) {
+    return (
+      <div className="flex justify-center my-6">
+        <Spinner className="w-6 text-gray_r-12/50 fill-gray_r-12" />
+      </div>
+    )
+  }
+
   return (
     <div className="px-4 py-6">
-      { wishlists.isLoading && (
-        <Spinner className="w-6 h-6 text-gray-600 fill-gray-900 mx-auto" />
-      ) }
       { wishlists.data?.products?.length == 0 && (
         <Alert type='info' className='text-center'>
           Wishlist anda masih kosong
         </Alert>
       ) }
+      
       <div className="grid grid-cols-2 gap-3">
         {wishlists.data?.products.map((product) => (
           <ProductCard key={product.id} data={product} />
-- 
cgit v1.2.3


From 3c559031623649a67825ff47f34512f0eb946861 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 22 Feb 2023 10:14:32 +0700
Subject: fix

---
 src/lib/wishlist/components/Wishlists.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/wishlist/components/Wishlists.jsx')

diff --git a/src/lib/wishlist/components/Wishlists.jsx b/src/lib/wishlist/components/Wishlists.jsx
index 4bb63933..8cbbb0a2 100644
--- a/src/lib/wishlist/components/Wishlists.jsx
+++ b/src/lib/wishlist/components/Wishlists.jsx
@@ -33,7 +33,7 @@ const Wishlists = () => {
       
       <div className="grid grid-cols-2 gap-3">
         {wishlists.data?.products.map((product) => (
-          <ProductCard key={product.id} data={product} />
+          <ProductCard key={product.id} product={product} />
         ))}
       </div>
 
-- 
cgit v1.2.3


From f66b12fd1d0b83af0d7230d7b1565fbe00afbe3c Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 22 Feb 2023 11:03:34 +0700
Subject: prettier

---
 src/lib/wishlist/components/Wishlists.jsx | 34 +++++++++++++++----------------
 1 file changed, 16 insertions(+), 18 deletions(-)

(limited to 'src/lib/wishlist/components/Wishlists.jsx')

diff --git a/src/lib/wishlist/components/Wishlists.jsx b/src/lib/wishlist/components/Wishlists.jsx
index 8cbbb0a2..71ac095e 100644
--- a/src/lib/wishlist/components/Wishlists.jsx
+++ b/src/lib/wishlist/components/Wishlists.jsx
@@ -1,15 +1,13 @@
-import Alert from "@/core/components/elements/Alert/Alert"
-import Pagination from "@/core/components/elements/Pagination/Pagination"
-import Spinner from "@/core/components/elements/Spinner/Spinner"
-import ProductCard from "@/lib/product/components/ProductCard"
-import { useRouter } from "next/router"
-import useWishlists from "../hooks/useWishlists"
+import Alert from '@/core/components/elements/Alert/Alert'
+import Pagination from '@/core/components/elements/Pagination/Pagination'
+import Spinner from '@/core/components/elements/Spinner/Spinner'
+import ProductCard from '@/lib/product/components/ProductCard'
+import { useRouter } from 'next/router'
+import useWishlists from '../hooks/useWishlists'
 
 const Wishlists = () => {
   const router = useRouter()
-  const {
-    page = 1
-  } = router.query
+  const { page = 1 } = router.query
   const limit = 30
   const { wishlists } = useWishlists({ page, limit })
 
@@ -17,31 +15,31 @@ const Wishlists = () => {
 
   if (wishlists.isLoading) {
     return (
-      <div className="flex justify-center my-6">
-        <Spinner className="w-6 text-gray_r-12/50 fill-gray_r-12" />
+      <div className='flex justify-center my-6'>
+        <Spinner className='w-6 text-gray_r-12/50 fill-gray_r-12' />
       </div>
     )
   }
 
   return (
-    <div className="px-4 py-6">
-      { wishlists.data?.products?.length == 0 && (
+    <div className='px-4 py-6'>
+      {wishlists.data?.products?.length == 0 && (
         <Alert type='info' className='text-center'>
           Wishlist anda masih kosong
         </Alert>
-      ) }
-      
-      <div className="grid grid-cols-2 gap-3">
+      )}
+
+      <div className='grid grid-cols-2 gap-3'>
         {wishlists.data?.products.map((product) => (
           <ProductCard key={product.id} product={product} />
         ))}
       </div>
 
-      <div className="mt-6">
+      <div className='mt-6'>
         <Pagination currentPage={page} pageCount={pageCount} url={`/my/wishlist`} />
       </div>
     </div>
   )
 }
 
-export default Wishlists
\ No newline at end of file
+export default Wishlists
-- 
cgit v1.2.3


From ac3fdf7be9982e65d8f83a20bc487f8dd62e3bfc Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 22 Feb 2023 23:36:47 +0700
Subject: fix

---
 src/lib/wishlist/components/Wishlists.jsx | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

(limited to 'src/lib/wishlist/components/Wishlists.jsx')

diff --git a/src/lib/wishlist/components/Wishlists.jsx b/src/lib/wishlist/components/Wishlists.jsx
index 71ac095e..e61efcc3 100644
--- a/src/lib/wishlist/components/Wishlists.jsx
+++ b/src/lib/wishlist/components/Wishlists.jsx
@@ -24,19 +24,29 @@ const Wishlists = () => {
   return (
     <div className='px-4 py-6'>
       {wishlists.data?.products?.length == 0 && (
-        <Alert type='info' className='text-center'>
+        <Alert
+          type='info'
+          className='text-center'
+        >
           Wishlist anda masih kosong
         </Alert>
       )}
 
       <div className='grid grid-cols-2 gap-3'>
         {wishlists.data?.products.map((product) => (
-          <ProductCard key={product.id} product={product} />
+          <ProductCard
+            key={product.id}
+            product={product}
+          />
         ))}
       </div>
 
       <div className='mt-6'>
-        <Pagination currentPage={page} pageCount={pageCount} url={`/my/wishlist`} />
+        <Pagination
+          currentPage={page}
+          pageCount={pageCount}
+          url={`/my/wishlist`}
+        />
       </div>
     </div>
   )
-- 
cgit v1.2.3

