From fa77da303b16d3b85d2c62dc3b42e23a2ff1ece8 Mon Sep 17 00:00:00 2001 From: Benjamin Kyd Date: Fri, 25 Mar 2022 23:07:14 +0000 Subject: [PATCH] product listings Former-commit-id: 8d87475b4577694132df338d5183a5edde6dbf5c --- client/public/components/compact-listing.mjs | 51 ++++++++++++++++--- client/public/components/product-list.mjs | 9 ++-- .../public/components/templates/navbar.html | 26 +++++----- client/public/global.css | 9 +--- db/image/0.tar.gz | 3 -- db/image/1.tar.gz | 3 -- db/image/2.tar.gz | 3 -- db/image/3.tar.gz | 3 -- db/image/4.tar.gz | 3 -- db/image/5.tar.gz | 3 -- db/image/6.tar.gz | 3 -- db/image/7.tar.gz | 3 -- db/image/8.tar.gz | 3 -- db/image/9.tar.gz | 3 -- db/image/a.tar.gz | 3 -- db/image/b.tar.gz | 3 -- db/image/c.tar.gz | 3 -- db/image/compressor.sh | 7 --- db/image/d.tar.gz | 3 -- db/image/decompressor.sh | 4 -- db/image/e.tar.gz | 3 -- db/image/f.tar.gz | 3 -- src/routes/sets-router.js | 47 +++++++++++++---- 23 files changed, 101 insertions(+), 100 deletions(-) delete mode 100644 db/image/0.tar.gz delete mode 100644 db/image/1.tar.gz delete mode 100644 db/image/2.tar.gz delete mode 100644 db/image/3.tar.gz delete mode 100644 db/image/4.tar.gz delete mode 100644 db/image/5.tar.gz delete mode 100644 db/image/6.tar.gz delete mode 100644 db/image/7.tar.gz delete mode 100644 db/image/8.tar.gz delete mode 100644 db/image/9.tar.gz delete mode 100644 db/image/a.tar.gz delete mode 100644 db/image/b.tar.gz delete mode 100644 db/image/c.tar.gz delete mode 100644 db/image/compressor.sh delete mode 100644 db/image/d.tar.gz delete mode 100644 db/image/decompressor.sh delete mode 100644 db/image/e.tar.gz delete mode 100644 db/image/f.tar.gz diff --git a/client/public/components/compact-listing.mjs b/client/public/components/compact-listing.mjs index 6d2ed19..72e9e21 100644 --- a/client/public/components/compact-listing.mjs +++ b/client/public/components/compact-listing.mjs @@ -10,18 +10,53 @@ class CompactProductListing extends Component { Render() { return { template: ` - - {this.state.name}

- {this.state.desc}

- £{this.state.price} +

+
+ +
+
+
{this.state.name}
+ + ${this.state.discount + ? '£{this.state.price}£{this.state.discount}' + : '£{this.state.price}'} + +
+
`, style: ` - compact-listing-component { + .product-listing { display: flex; - text-align: center; - width: 200px; flex-direction: column; - margin: 10px; + margin: 7px; + max-width: 320px; + } + .product-listing-image { + display: block; + margin: 0 auto; + max-width: 320px; + } + .product-listing-info { + display: flex; + align-items: flex-start; + flex-direction: column; + max-width: 320px; + } + .product-listing-name { + font-size: 1.2em; + font-weight: bold; + } + .product-listing-price { + font-size: 1.1em; + } + .product-listing-price-full { + text-decoration: line-through; + font-size: 0.9em; + } + .product-listing-price-new { + font-weight: bold; + color: red; + font-size: 1.1em; } `, }; diff --git a/client/public/components/product-list.mjs b/client/public/components/product-list.mjs index 6f4d460..0749b6b 100644 --- a/client/public/components/product-list.mjs +++ b/client/public/components/product-list.mjs @@ -17,18 +17,19 @@ class ProductList extends Component {
${products.data.map(product => { return ` + price="${product.price}" + discount="${product.discount || ''}"> `; - })} + }).join('')}
`, style: ` .product-list { display: flex; + justify-content: space-evenly; + flex-wrap: wrap; margin: 0 auto; - max-width: 800px; } `, state: { diff --git a/client/public/components/templates/navbar.html b/client/public/components/templates/navbar.html index b8079bd..b90b2a9 100644 --- a/client/public/components/templates/navbar.html +++ b/client/public/components/templates/navbar.html @@ -27,19 +27,19 @@