From 195fbaf556a2a811633c8d880271425ee6d63de6 Mon Sep 17 00:00:00 2001 From: isHardCoded Date: Mon, 7 Jul 2025 13:13:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=B5=D1=81?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=B2=D0=B5=D1=81=D1=8C=20=D0=BA=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=B2=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.jsx | 95 +-------------------------------- src/components/card/index.jsx | 26 +++++++++ src/components/header/index.jsx | 47 ++++++++++++++++ src/components/list/index.jsx | 30 +++++++++++ 4 files changed, 105 insertions(+), 93 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 3277cde..410e373 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,98 +1,7 @@ import styles from './App.module.scss' -import React from 'react' -/* HEADER ICONS */ -import CartIcon from './assets/icons/cart.svg' -import UserIcon from './assets/icons/user.svg' -import WishlistIcon from './assets/icons/wishlist.svg' -import LoopIcon from './assets/icons/loop.svg' - -/* PRODUCT CARD ICONS */ -import WishIcon from './assets/icons/wish.svg' - -const Header = () => { - return ( -
-

Exclusive

- -
- - -
-
- - - -
-
- ) -} - -const ProductCard = ({ name, price, imageUrl }) => { - return ( -
-
- -
- -
-
-
-

{name}

-
- ${price} -
-
-
- ) -} - -const ProductList = () => { - const [products, setProducts] = React.useState([]) - - const getProducts = async () => { - const response = await fetch('http://localhost:8000/products') - const data = await response.json() - setProducts(data) - } - - React.useEffect(() => { - getProducts() - }, []) - - return ( - - ) -} +import Header from './components/header' +import ProductList from './components/list' const App = () => { return ( diff --git a/src/components/card/index.jsx b/src/components/card/index.jsx index e69de29..f691e56 100644 --- a/src/components/card/index.jsx +++ b/src/components/card/index.jsx @@ -0,0 +1,26 @@ +import styles from './index.module.scss' + +import WishIcon from '../../assets/icons/wish.svg' + +const ProductCard = ({ name, price, imageUrl }) => { + return ( +
+
+ +
+ +
+
+
+

{name}

+
+ ${price} +
+
+
+ ) +} + +export default ProductCard diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index e69de29..277a326 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -0,0 +1,47 @@ +import styles from './index.module.scss' + +import CartIcon from '../../assets/icons/cart.svg' +import UserIcon from '../../assets/icons/user.svg' +import WishlistIcon from '../../assets/icons/wishlist.svg' +import LoopIcon from '../../assets/icons/loop.svg' + +const Header = () => { + return ( +
+

Exclusive

+ +
+ + +
+
+ + + +
+
+ ) +} + +export default Header diff --git a/src/components/list/index.jsx b/src/components/list/index.jsx index e69de29..e6db08e 100644 --- a/src/components/list/index.jsx +++ b/src/components/list/index.jsx @@ -0,0 +1,30 @@ +import React from 'react' +import styles from './index.module.scss' + +import ProductCard from '../card' + +const ProductList = () => { + const [products, setProducts] = React.useState([]) + + const getProducts = async () => { + const response = await fetch('http://localhost:8000/products') + const data = await response.json() + setProducts(data) + } + + React.useEffect(() => { + getProducts() + }, []) + + return ( + + ) +} + +export default ProductList