Skip to content

Commit

Permalink
refactor: Details image from public
Browse files Browse the repository at this point in the history
  • Loading branch information
dano2906 committed Oct 21, 2023
1 parent dffef40 commit 3a53298
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {paginatedData: products,nextPage,prevPage,isLastPage,isFirtPage,quantity}
<div class="max-w-sm p-2 mx-auto sm:max-w-md md:max-w-4xl">
<h1 class="text-lg font-bold sm:text-3xl font-tilt text-purple-950">Cantidad de productos encontrados: {quantity}</h1>
<ul class="grid grid-cols-1 p-2 sm:grid-cols-2 md:grid-cols-3 gap-y-2 sm:gap-2">
{products.map((product)=>(
{products.map((product: any)=>(
<ProductCard product={product}/>
))}
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import MainLayout from "@layouts/MainLayout.astro";
import { Image } from "astro:assets";
import productImage from "../../../../public/placeholder-product-image.png"
const {id} = Astro.params
const res = await fetch(Astro.url.origin + `/api/items/${id}/data.json`)
const {product} = await res.json()
Expand All @@ -11,7 +10,7 @@ const {title,description,price,category,rating,stock,brand,discountPercentage} =

<MainLayout title={`Producto numero ${id}`} description="Tienda implementada para la prueba técnica #2 de midudev basada en una prueba de Mercado Libre" keywords={['prueba tecnica','desarrollo','tienda online']}>
<section class="max-w-sm sm:max-w-md md:max-w-2xl lg:max-w-4xl mx-auto h-screen flex flex-col items-center justify-start gap-y-2 mt-10 sm:mt-0">
<Image src={productImage} alt={title} width={192} height={192} class="relative rounded-lg" transition:name="img"/>
<Image src={"/placeholder-product-image.png"} alt={title} width={192} height={192} class="relative rounded-lg" transition:name="img"/>
<span class="absolute px-1 rounded-full text-base font-tilt font-normal bg-purple-950 text-purple-50">{stock}</span>
<h2 class="text-2xl font-tilt font-bold text-purple-950" transition:name="title">{title}</h2>
<p class="text-lg font-tilt font-light text-purple-950" transition:name="desc">{description}</p>
Expand Down

0 comments on commit 3a53298

Please sign in to comment.