Skip to content

Commit

Permalink
Update cart items spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
rayc2045 committed May 23, 2024
1 parent 38f3430 commit 6ecd451
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
18 changes: 11 additions & 7 deletions src/pages/shop/cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
x-show="cart.items.length"
class="grid lg:grid-cols-12 gap-8 md:px-12 lg:p-0 relative"
>
<div class="lg:col-span-8">
<ul class="lg:col-span-8">
<template x-for="item in cart.items" :key="item.name">
<div
<li
x-data="{ lowerName: item.name.toLowerCase().replaceAll(' ', '_') }"
class="py-8 grid grid-cols-12 gap-4 sm:gap-8 border-t border-gray-300"
>
Expand All @@ -22,9 +22,13 @@
</a>

<div class="col-span-5 self-center space-y-2">
<h3 x-text="item.name" class="text-lg font-bold"></h3>
<div class="text-gray-500">
Color:
<a
:href="`#/shop/${item.category}/${lowerName}?color=${item.color}`"
>
<h3 x-text="item.name" class="text-lg font-bold"></h3>
</a>
<div class="flex items-center space-x-2 text-gray-500">
<span>Color:</span>
<span x-text="capitalizeFirstLetter(item.color)"></span>
</div>
<div class="flex items-center space-x-2 text-gray-500">
Expand Down Expand Up @@ -71,9 +75,9 @@ <h3 x-text="item.name" class="text-lg font-bold"></h3>
</button>
</div>
</div>
</li>
</template>
</div>
</ul>

<div
id="order-summary"
Expand Down
23 changes: 13 additions & 10 deletions src/pages/shop/checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ <h2 class="text-xl font-bold">Payment Options</h2>
<div x-cloak x-show="open" x-transition.origin.top>
<ul>
<template x-for="(item, idx) in cart.items" :key="item.name">
<div
<li
x-data="{ lowerName: item.name.toLowerCase().replaceAll(' ', '_') }"
class="py-8 grid grid-cols-12 gap-x-4"
class="py-6 grid grid-cols-12 gap-x-4"
:class="idx > 0 && 'border-t border-gray-300'"
>
<a
Expand All @@ -50,11 +50,15 @@ <h2 class="text-xl font-bold">Payment Options</h2>

<div
:class="item.num > 100 ? 'col-span-6' : 'col-span-7'"
class="self-center space-y-2"
class="self-center space-y-1"
>
<h3 x-text="item.name" class="text-lg font-bold"></h3>
<div class="text-gray-500">
Color:
<a
:href="`#/shop/${item.category}/${lowerName}?color=${item.color}`"
>
<h3 x-text="item.name" class="text-lg font-bold"></h3>
</a>
<div class="flex items-center space-x-2 text-gray-500">
<span>Color:</span>
<span x-text="capitalizeFirstLetter(item.color)"></span>
</div>
<div class="flex items-center space-x-2 text-gray-500">
Expand All @@ -74,11 +78,10 @@ <h3 x-text="item.name" class="text-lg font-bold"></h3>
:class="item.num > 100 ? 'col-span-3' : 'col-span-2'"
class="self-center mx-auto"
>
<span class="text-sm"></span>&nbsp;<span
x-text="`${item.num}`"
></span>
<span class="text-sm"></span>
<span x-text="`${item.num}`"></span>
</div>
</div>
</li>
</template>
</ul>
<a href="#/cart" :class="btn.outlined">
Expand Down

0 comments on commit 6ecd451

Please sign in to comment.