Добавили обработчик событий по клику на карточку товара, создали компонент Header, установили библиотеку react-icons
This commit is contained in:
+16
-1
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user