-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ef6486
commit 8e8e38e
Showing
3 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.products { | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.products ul { | ||
display: grid; | ||
grid-template-columns: repeat( | ||
auto-fit, | ||
minmax( | ||
200px, | ||
1fr | ||
) | ||
); | ||
gap: 1rem; | ||
} | ||
|
||
.products li { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
box-shadow: 0 0 10px 10px rgba(0, 0, 0, .1); | ||
border-radius: 4px; | ||
background: #111; | ||
color: #fff; | ||
padding: 1rem; | ||
} | ||
|
||
.products h3 { | ||
margin: 0; | ||
} | ||
|
||
.products span { | ||
font-size: 1rem; | ||
opacity: .9; | ||
} | ||
|
||
.products img { | ||
border-radius: 4px; | ||
width: 100%; | ||
aspect-ratio: 16/9; | ||
display: block; | ||
object-fit: cover; | ||
background: #fff; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-disable react/prop-types */ | ||
import './Products.css' | ||
import { AddToCartIcon } from '../Icons/Icons.jsx' | ||
|
||
export function Products ({ products }) { | ||
return ( | ||
<main className='products'> | ||
<ul> | ||
{products.map(product => ( | ||
<li key={product.id}> | ||
<img | ||
src={product.thumbnail} | ||
alt={product.title} | ||
/> | ||
|
||
<div> | ||
<strong>{product.title}</strong> - {product.price}€ | ||
</div> | ||
|
||
<div> | ||
<button> | ||
<AddToCartIcon /> | ||
</button> | ||
</div> | ||
</li> | ||
))} | ||
</ul> | ||
|
||
</main> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters