Добавили обработчик событий по клику на карточку товара, создали компонент Header, установили библиотеку react-icons

This commit is contained in:
isHardCoded
2025-06-16 12:48:23 +03:00
parent 9367009fdf
commit 2ba1a63832
4 changed files with 35 additions and 4 deletions
+16 -1
View File
@@ -1,14 +1,26 @@
import styles from './App.module.css'
import SneakersImage from './assets/images/sneakers-image.jpg'
function Header() {
return (
<header className={styles.header}>
<h2>Logo</h2>
</header>
)
}
function Product() {
function handleClick() {
console.log('Working!')
}
return (
<div className={styles.product}>
<img src={SneakersImage} alt='' />
<div className={styles.content}>
<div className={styles.title}>
<h4>Sneakers Red & White 2025</h4>
<button>+</button>
<button onClick={event => handleClick(event)}>+</button>
</div>
<p className={styles.description}>NIKE</p>
<p className={styles.price}>$38.00</p>
@@ -20,6 +32,9 @@ function Product() {
function App() {
return (
<>
<div className={styles.container}>
<Header />
</div>
<div className={styles.container}>
<ul className={styles.list}>
<li>
+5
View File
@@ -1,3 +1,7 @@
.header {
display: flex;
}
.container {
max-width: 1220px;
margin: 0 auto;
@@ -6,6 +10,7 @@
.list {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
border-radius: 10px;
margin-top: 100px; /* временно */
padding: 20px;