Skip to content

Commit

Permalink
Update label element
Browse files Browse the repository at this point in the history
  • Loading branch information
rayc2045 committed May 10, 2024
1 parent cb2325a commit a964730
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/components/product-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,11 @@

<div class="flex justify-between items-start">
<div id="product-title">
<small class="text-xs font-semibold">
<template x-if="product.stock === 'in stock'">
<span
x-text="product.label && product.label[0].toUpperCase() + product.label.slice(1)"
class="text-red-500"
></span>
</template>
<template x-if="product.stock !== 'in stock'">
<span
x-text="product.stock[0].toUpperCase() + product.stock.slice(1)"
class="text-blue-500"
></span>
</template>
</small>
<small
x-text="product.stock === 'in stock' ? (product.label && product.label[0].toUpperCase() + product.label.slice(1)) : product.stock[0].toUpperCase() + product.stock.slice(1)"
class="text-xs font-semibold"
:class="`text-${product.stock === 'in stock' ? 'red' : 'blue'}-500`"
></small>
<a
:href="`#/shop/${product.category}/${lowerName}?color=${currentColor}`"
class="block mb-1"
Expand Down

0 comments on commit a964730

Please sign in to comment.