design upgrade
This commit is contained in:
@@ -2,7 +2,6 @@ import ItemsTemplate from "./items"
|
||||
import Summary from "./summary"
|
||||
import EmptyCartMessage from "../components/empty-cart-message"
|
||||
import SignInPrompt from "../components/sign-in-prompt"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
|
||||
const CartTemplate = ({
|
||||
@@ -12,34 +11,34 @@ const CartTemplate = ({
|
||||
cart: HttpTypes.StoreCart | null
|
||||
customer: HttpTypes.StoreCustomer | null
|
||||
}) => {
|
||||
const count = cart?.items?.reduce((sum, i) => sum + i.quantity, 0) ?? 0
|
||||
|
||||
return (
|
||||
<div className="py-8 sm:py-12">
|
||||
<div className="content-container" data-testid="cart-container">
|
||||
{cart?.items?.length ? (
|
||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
|
||||
<div className="lg:col-span-8 flex flex-col gap-6">
|
||||
{!customer && (
|
||||
<>
|
||||
<SignInPrompt />
|
||||
<Separator />
|
||||
</>
|
||||
)}
|
||||
<div className="content-container pb-20 sm:pb-28" data-testid="cart-container">
|
||||
{cart?.items?.length ? (
|
||||
<>
|
||||
<header className="pt-14 sm:pt-20 pb-10 sm:pb-14 text-center">
|
||||
<p className="eyebrow">Korpa</p>
|
||||
<h1 className="display-heading mt-5 text-4xl sm:text-6xl text-foreground">Vaša korpa</h1>
|
||||
<p className="mt-4 text-sm text-muted-foreground">
|
||||
{count % 10 === 1 && count % 100 !== 11 ? `${count} artikal` : `${count} artikala`} · Dostava za
|
||||
24–48h širom BiH ili preuzimanje u Gračanici
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-10 lg:gap-16 items-start">
|
||||
<div className="lg:col-span-7 xl:col-span-8 flex flex-col gap-8">
|
||||
<ItemsTemplate cart={cart} />
|
||||
{!customer && <SignInPrompt />}
|
||||
</div>
|
||||
<div className="lg:col-span-4 sticky top-24">
|
||||
{cart && cart.region && (
|
||||
<div className="rounded-xl border border-border bg-card p-6 shadow-sm">
|
||||
<Summary cart={cart} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<aside className="lg:col-span-5 xl:col-span-4 lg:sticky lg:top-28">
|
||||
{cart.region && <Summary cart={cart} />}
|
||||
</aside>
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<EmptyCartMessage />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<EmptyCartMessage />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user