Stable-1
This commit is contained in:
1 parent
9f4fbfd963
commit
655fd7ff2c
26 files changed
+839
-513
No files matched your search
@@ -12,10 +12,25 @@ const Page = ()=>{
|
||||
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
useEffect(()=>{
|
||||
|
||||
},[])
|
||||
|
||||
const query = useQuery({ queryKey: ['categoryProducts'], queryFn: async ()=>{
|
||||
|
||||
return await axiosInstance.get("shop/v2/product-category/list/")
|
||||
},refetchOnWindowFocus:false, onSuccess(result:any) {
|
||||
|
||||
setCategory(result.data)
|
||||
|
||||
setTimeout(async ()=>{
|
||||
const scrollpos = localStorage.getItem('scrollY')
|
||||
if (scrollpos){
|
||||
await window.scrollTo(0, parseInt(scrollpos));
|
||||
}
|
||||
|
||||
},150)
|
||||
|
||||
}, })
|
||||
|
||||
if(query.isLoading){
|
||||
@@ -35,7 +50,6 @@ const Page = ()=>{
|
||||
return (
|
||||
<>
|
||||
<div className="grid grid-cols-2 min-[1350px]:grid-cols-5 min-[767px]:grid-cols-3 min-[1100px]:grid-cols-4 gap-x-2 gap-y-2">
|
||||
|
||||
{query.isSuccess?category.map((iteam:any)=>{
|
||||
return <ProductCategoryBox key={iteam.id} iteam={iteam} />
|
||||
}):null}
|
||||
|
||||
Reference in new issue
Block a user