diff --git a/frontend/src/pages/productDetails/ProductDetailsPage.css b/frontend/src/pages/productDetails/ProductDetailsPage.css index 3c9a3ce..58950b0 100644 --- a/frontend/src/pages/productDetails/ProductDetailsPage.css +++ b/frontend/src/pages/productDetails/ProductDetailsPage.css @@ -267,57 +267,6 @@ list-style: none; } -.product-details-page .store-price-row { - display: grid; - grid-template-columns: 24px minmax(0, 1fr) 88px 90px; - align-items: center; - gap: 8px; - min-height: 46px; - padding: 12px 16px; - border-top: 1px solid var(--border-brand); -} - -.product-details-page .store-price-row.cheapest { - background: var(--bg-tint); -} - -.product-details-page .store-number { - color: var(--text-accent); - font-size: 10px; - font-weight: 700; -} - -.product-details-page .store-name { - color: var(--text-primary); - font-size: 13px; - font-weight: 500; -} - -.product-details-page .store-difference { - color: var(--text-muted); - font-size: 10px; - text-align: right; - white-space: nowrap; -} - -.product-details-page .cheapest .store-difference { - justify-self: end; - padding: 5px 7px; - border-radius: 3px; - background: var(--text-accent); - color: white; - font-size: 9px; - font-weight: 700; -} - -.product-details-page .store-price { - color: var(--text-primary); - font-size: 13px; - font-weight: 600; - text-align: right; - white-space: nowrap; -} - /* ===== HANDLELISTE ===== */ .product-details-page .shopping-list-controls { position: relative; @@ -360,41 +309,10 @@ } .product-details-page .quantity-controls { - display: inline-flex; - align-items: center; - border: 1px solid var(--border-hairline); - border-radius: 5px; - overflow: hidden; grid-column: 1; margin-top: 12px; } -.product-details-page .quantity-controls button { - min-width: 32px; - min-height: 32px; - padding: 4px; - background: var(--bg-surface); - border: none; - color: var(--text-primary); - cursor: pointer; -} - -.product-details-page .quantity-controls button:hover:not(:disabled) { - background: var(--bg-tint); -} - -.product-details-page .quantity-controls button:disabled { - opacity: 0.4; - cursor: not-allowed; -} - -.product-details-page .quantity-controls output { - min-width: 24px; - text-align: center; - font-size: 12px; - color: var(--text-primary); -} - .product-details-page .remove-product { grid-column: 2; justify-self: start; @@ -510,24 +428,6 @@ } @media (max-width: 480px) { - .product-details-page .store-price-row { - grid-template-columns: 20px minmax(0, 1fr) auto; - gap: 6px; - padding: 12px; - } - - .product-details-page .store-difference { - grid-column: 2; - grid-row: 2; - text-align: left; - justify-self: start; - } - - .product-details-page .store-price { - grid-column: 3; - grid-row: 1 / 3; - } - .product-details-page .shopping-list-controls { padding: 20px 16px; } diff --git a/frontend/src/pages/productDetails/ProductDetailsPage.tsx b/frontend/src/pages/productDetails/ProductDetailsPage.tsx index 6723a18..dc9ca26 100644 --- a/frontend/src/pages/productDetails/ProductDetailsPage.tsx +++ b/frontend/src/pages/productDetails/ProductDetailsPage.tsx @@ -1,6 +1,8 @@ import { useState } from "react"; import { useQuery } from "@apollo/client/react"; import { PRODUCT_QUERY } from "./productQueries"; +import PriceRow from "../../components/priceRow/PriceRow"; +import QuantityStepper from "../../components/quantityStepper/QuantityStepper"; import "./ProductDetailsPage.css"; type ProductDetailsPageProps = { @@ -150,28 +152,14 @@ export default function ProductDetailsPage({ const difference = item.price - (cheapest?.price ?? item.price); return ( -
  • - - {String(index + 1).padStart(2, "0")} - - - - {getStoreName(item.storeCode)} - - - - {index === 0 - ? "BILLIGST" - : `+${formatPrice(difference)} KR`} - - - - {item.price.toFixed(2).replace(".", ",")} kr - -
  • + number={String(index + 1).padStart(2, "0")} + store={getStoreName(item.storeCode)} + price={`${formatPrice(item.price)} kr`} + difference={`+${formatPrice(difference)} KR`} + cheapest={index === 0} + /> ); })} @@ -186,29 +174,16 @@ export default function ProductDetailsPage({ {isInList ? "Står på lappen din" : "Ikke på lappen din"} -
    - - - {isInList ? quantity : 0} - - -
    + />