Skip to content

Commit

Permalink
fix: styles and empty cart info (#1003)
Browse files Browse the repository at this point in the history
Co-authored-by: Michał Miszczyszyn <[email protected]>
  • Loading branch information
grzegorzpokorski and typeofweb authored Oct 31, 2023
1 parent 29bb67f commit dab9391
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/(main)/cart/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function Page() {

const checkout = await Checkout.find(checkoutId);

if (!checkout) {
if (!checkout || checkout.lines.length < 1) {
return (
<section className="mx-auto max-w-7xl p-8">
<h1 className="mt-8 text-3xl font-bold text-neutral-900">Your Shopping Cart is empty</h1>
Expand Down Expand Up @@ -80,7 +80,7 @@ export default async function Page() {

<div className="mt-12">
<div className="rounded border bg-neutral-50 px-4 py-2">
<div className="flex items-center justify-between py-2">
<div className="flex items-center justify-between gap-2 py-2">
<div>
<p className="font-semibold text-neutral-900">Your Total</p>
<p className="mt-1 text-sm text-neutral-500">Shipping will be calculated in the next step</p>
Expand All @@ -91,7 +91,11 @@ export default async function Page() {
</div>
</div>
<div className="mt-10 text-center">
<CheckoutLink checkoutId={checkoutId} disabled={!checkout.lines.length} className="w-1/3" />
<CheckoutLink
checkoutId={checkoutId}
disabled={!checkout.lines.length}
className="w-full sm:w-1/3"
/>
</div>
</div>
</form>
Expand Down

0 comments on commit dab9391

Please sign in to comment.