import { Menu as Sitemap, Shell } from 'kit/ui/chrome.jsx'; import { configure } from 'kit/ui/config.js'; import site from '../site.json'; import { cdnUrl, grid, money, ogUrl, tileUrl } from './shop.ts'; configure(site); const CATEGORIES = [ ['accessories', 'Accessories'], ['bags', 'Bags'], ['kids', 'Kids'], ['men', 'Men'], ['unisex', 'Unisex'], ['women', 'Women'], ]; /* SHELL */ export function Page({ route, nav, controls, wide, children }) { return ( {children} ); } /* PIECES */ function Card({ product, width = 600, eager = false, pick = 0 }) { const image = product.images.length ? product.images[pick % product.images.length] : null; return ( {image ? ( {image.alt ) : ( {product.title} )}

{product.title}

{money(product.price)}

); } function Gallery({ products, eager = 0 }) { return (
{products.map((product, i) => ( ))}
); } export function Filter({ label, count, next }) { return ( <> {`${label} (${count})`} ); } function Deck({ cards }) { return (
{cards.map((card) => ( {card.image ? ( {card.name} ) : card.key ? ( {card.name} ) : null}

{card.emoji ? {card.emoji} : null} {card.name}

{`${card.count} design${card.count === 1 ? '' : 's'}`}

))}
); } /* HOME */ export function Home({ products, lead }) { return ( <>

{site.name}

{lead}

); } /* COLLECTIONS */ export function Collections({ groups, lead }) { return ( <>

Collections

{lead}

{groups.map((group) => (

{group.name}

))} ); } export function Collection({ name, products }) { return ( <>

{name}

{`${products.length} design${products.length === 1 ? '' : 's'}`}

); } /* PRODUCT */ export function Product({ product, siblings, collection, files, tiles }) { const images = product.images; return ( <>

{product.title}

Design {product.key}

{images.map((image, i) => ( {image.alt} ))}
{tiles.map((n) => ( {`${product.key} ))}

Download {files.map((name) => ( {name} ))} {tiles.map((n) => ( {`${n}x${n}`} ))} og

Designs

{siblings.map((one) => ( {one.key}

{money(one.price)}

))}
); } export function Controls({ product, printful, sizes, index, total, buy, expires, live }) { return ( <>

{money(product.price)}

{sizes.length > 1 && (
{sizes.map((size) => ( ))}
)} Buy now

{`${index + 1} / ${total}`}
View on Printful ); } /* CART */ export function Cart() { return ( <>

Cart

); } /* PAGES */ export function Menu({ tree }) { return ( <>

Menu

Every page on {site.name}.

Elsewhere

); } export function Doc({ title, lead, body, hero, action }) { return ( <> {hero && (
)}

{title}

{lead &&

{lead}

}
{action && (

{action.name}

)} {body &&
} ); } export function NotFound() { return (

Not found

That page is gone, or the design expired.

Back to the shop

); }