${product.price * quantity}
+diff --git a/src/App.scss b/src/App.scss index 71bc413aade..7f309bd824b 100644 --- a/src/App.scss +++ b/src/App.scss @@ -1 +1,39 @@ -// not empty +// not empty +.App { + min-height: 100vh; + margin: 0; + background-color: #0f1121; + display: flex; + flex-direction: column; +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +@font-face { + font-family: Mont; + src: url('../fonts/Mont-Regular.otf') format('opentype'); + font-weight: 400; +} + +@font-face { + font-family: Mont; + src: url('../fonts/Mont-SemiBold.otf') format('opentype'); + font-weight: 600; +} + +@font-face { + font-family: Mont; + src: url('../fonts/Mont-Bold.otf') format('opentype'); + font-weight: 700; +} + +.main { + background-color: #0f1121; + width: 100%; + flex: 1 0 auto; +} + diff --git a/src/App.tsx b/src/App.tsx index 372e4b42066..622d99b3f7f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,65 @@ +import React from 'react'; +import { Navigate, Route, Routes } from 'react-router-dom'; import './App.scss'; +import { Header } from './components/Header/Header'; +import { CatalogPage } from './components/CatalogPage'; +import { getAccessories, getPhones, getTablets } from './api'; +import { HomePage } from './components/HomePage/HomePage'; +import { FavoritesPage } from './components/FavoritesPage/FavoritesPage'; +import { CartPage } from './components/CartPage/CartPage'; +// eslint-disable-next-line max-len +import { ProductDetailsPage } from './components/ProductDeatils/ProductDetailsPage'; +import { NotFoundPage } from './components/NotFoundPage/NotFoundPage'; +import { Footer } from './components/Footer/Footer'; export const App = () => (
Your cart is empty
+ ) : ( +${product.price * quantity}
+Something went wrong...
+ + + > + ); + } + + if (!products.length) { + return{emptyMessage}
; + } + + const hasSearchQuery = normalizedQuery.length > 0; + const hasNoSearchResults = hasSearchQuery && !visibleProducts.length; + const noResultMessage = `There are no ${breadcrumbLabel.toLowerCase()} matching the query`; + const shouldShowPagination = !hasNoSearchResults && totalPages > 1; + + return ( +{visibleProducts.length} models
+ +{noResultMessage}
+ ) : ( ++ {visibleFavoriteProducts.length} items +
+ + {!favoriteProducts.length ? ( +Your favorites list is empty
+ ) : !visibleFavoriteProducts.length ? ( ++ There are no products matching the query +
+ ) : ( +{count} models
+ + ); + })} +
+
+ 404 error
+ ++ The page you are looking for does not exist or was moved. +
+ + + Back to Home + ++ ${showDiscount ? product.price : product.fullPrice} +
+ {showDiscount && ( +${product.fullPrice}
+ )} +Something went wrong...
+ + + > + ); + } + + if (!product) { + returnProduct was not found
; + } + + const currentImage = selectedImage || product.images[0]; + const productCode = product.id.slice(-6).toUpperCase(); + + const getVariantByOptions = (color: string, capacity: string) => + productVariants.find( + variant => variant.color === color && variant.capacity === capacity, + ); + + const isProductInCart = currentProduct + ? isInCart(currentProduct.itemId) + : false; + + const isProductFavorite = currentProduct + ? isFavorite(currentProduct.itemId) + : false; + + return ( +Available colors
+ID: {productCode}
+Select capacity
+ID: {productCode}
+ ++ {paragraph} +
+ ))} +