Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1fa1d19
add and styled Header, ShopByCategory, ProductCarousel, ProductCard a…
Nov 19, 2025
76296b9
Fix mistake
Nov 19, 2025
a115e1f
Fix mistake with hover color
Nov 19, 2025
72bc1da
Add footer components and Catalog Page. Updates routes.
Nov 29, 2025
40ed30f
Tasks solution
Vovanchu Feb 23, 2026
7125863
Tasks solution
Vovanchu Feb 23, 2026
ae05c07
Merge branch 'mate-academy:master' into develop
Vovanchu Feb 23, 2026
6dc5e17
Change BrowserRouter to HashRouter
Vovanchu Feb 23, 2026
2b79d81
Add base url
Vovanchu Mar 4, 2026
fcadf95
Add another homePage url
Vovanchu Mar 4, 2026
f8d27e3
Add base url for API
Vovanchu Mar 4, 2026
cb392a9
Change all url for items photo
Vovanchu Mar 4, 2026
c95dbbd
Fix search bar in catalog page
Vovanchu Mar 4, 2026
c8278da
Fix mistake with Pagination. Update calculation method in carts
Vovanchu Mar 5, 2026
6c060b5
Add a reducer to calculate the total number of items in the cart, add…
Vovanchu Mar 5, 2026
2530536
Add hover effect for capacity, available color and ProductCard
Vovanchu Mar 5, 2026
364d3f4
Add hover effect for capacity, available color and ProductCard
Vovanchu Mar 5, 2026
c845009
Fix mistake in Cart page, add another Font-family for product-title
Vovanchu Mar 6, 2026
f74a9f9
Fix mistake in Cart page, add another Font-family for product-title
Vovanchu Mar 6, 2026
211f3a4
Fix mistake in Cart page, add another Font-family for product-title
Vovanchu Mar 6, 2026
7b9085d
Fix color display settings and change font-family in product card des…
Vovanchu Mar 7, 2026
12d7ee9
Fix color display settings and change font-family in product card des…
Vovanchu Mar 7, 2026
4bd5028
Fix color display settings and change font-family in product card des…
Vovanchu Mar 7, 2026
177e2f1
Fix adding product to cart in Items page
Vovanchu Mar 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ESLINT_NO_DEV_ERRORS=true
VITE_API_BASE=/react_phone-catalog/api/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ raw_reports
reports
cypress/screenshots
cypress/videos

.env
8 changes: 7 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<link
rel="icon"
type="image/x-icon"
href="./public/img/product-not-found.png"
/>

<title>Electronics store</title>
</head>
<body>
<div id="root"></div>
Expand Down
8,095 changes: 4,619 additions & 3,476 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
{
"homepage": "https://Vovanchu.github.io/react_phone-catalog/",
"name": "react_phone-catalog",
"homepage": "react_phone-catalog",
"version": "0.1.0",
"keywords": [],
"author": "Mate Academy",
"license": "GPL-3.0",
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@fortawesome/fontawesome-free": "^6.5.2",
"@mui/material": "^7.3.8",
"@reduxjs/toolkit": "^2.11.2",
"bulma": "^1.0.1",
"classnames": "^2.5.1",
"lodash.debounce": "^4.0.8",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-redux": "^9.2.0",
"react-router-dom": "^6.25.1",
"react-transition-group": "^4.4.5"
},
"devDependencies": {
"@cypress/react18": "^2.0.1",
"@mate-academy/scripts": "^1.8.5",
"@mate-academy/scripts": "^2.1.2",
"@mate-academy/students-ts-config": "*",
"@mate-academy/stylelint-config": "*",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-transition-group": "^4.4.10",
"@typescript-eslint/parser": "^7.16.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-react": "^5.1.4",
"cypress": "^13.13.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^18.0.0",
Expand All @@ -36,14 +42,15 @@
"eslint-plugin-react": "^7.34.4",
"eslint-plugin-react-hooks": "^4.6.2",
"gh-pages": "^6.1.1",
"husky": "^9.1.7",
"mochawesome": "^7.1.3",
"mochawesome-merge": "^4.3.0",
"mochawesome-report-generator": "^6.2.0",
"prettier": "^3.3.2",
"sass": "^1.77.8",
"stylelint": "^16.7.0",
"typescript": "^5.2.2",
"vite": "^5.3.1"
"vite": "^7.3.1"
},
"scripts": {
"start": "mate-scripts start -l",
Expand Down
1 change: 0 additions & 1 deletion public/api/phones.json
Original file line number Diff line number Diff line change
Expand Up @@ -4386,7 +4386,6 @@
"images": [
"img/phones/apple-iphone-12/white/00.webp",
"img/phones/apple-iphone-12/white/01.webp",
"img/phones/apple-iphone-12/white/02.webp",
"img/phones/apple-iphone-12/white/03.webp"
],
"description": [
Expand Down
Binary file added public/img/CartHurt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Chevron.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ChevronLeft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ChevronRight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/FavoritesHurt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion src/App.scss
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
// not empty
html {
scroll-behavior: smooth;
overflow-x: hidden;
margin: 0;
padding: 0;
}

body {
overflow-x: hidden;
margin: 0;
padding: 0;
}

h1,
h2,
h3,
p {
margin: 0;
padding: 0;
}
21 changes: 16 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import { Footer } from './components/Footer';
import { Header } from './components/Header';
import { AppRouter } from './router/AppRouter';
import './App.scss';

export const App = () => (
<div className="App">
<h1>Product Catalog</h1>
</div>
);
const App = () => {
return (
<>
<Header />
<main>
<AppRouter />
</main>
<Footer />
</>
);
};

export default App;
5 changes: 5 additions & 0 deletions src/UI/Buttons/Icons/CartHurt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/UI/Buttons/Icons/ChevronRight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/UI/Buttons/Icons/DeleteCart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/UI/Buttons/Icons/FavoritesHurtActive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/UI/Buttons/Icons/FavouritesHurtAnactive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/UI/Buttons/Icons/Phones.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/UI/Buttons/Icons/Phones2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/UI/Buttons/Icons/Tablets.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/UI/photos/Banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions src/UI/photos/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/UI/photos/banner-accessories.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/UI/photos/banner-phones.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/UI/photos/banner-tablets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/UI/photos/page-not-found.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/UI/photos/product-not-found.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/BannerCarousel/BannerCarousel.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@use '../../styles/variables' as vars;
40 changes: 40 additions & 0 deletions src/components/BannerCarousel/BannerCarousel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { useState } from 'react';
import styles from './BannerCarousel.module.scss';

const banners = [
'/img/banner-accessories.png',
'/img/banner-phones.png',
'/img/banner-tablets.png',
];

export const BannerCarousel = () => {
const [index, setIndex] = useState(0);

const prev = () => {
setIndex(curr => (curr === 0 ? banners.length - 1 : curr - 1));
};

const next = () => {
setIndex(curr => (curr === banners.length - 1 ? 0 : curr + 1));
};

return (
<div className={styles.carousel}>
<button data-cy="carousel-prev" onClick={prev}>
</button>

<img
src={banners[index]}
alt="carousel banner"
className={styles.carousel__img}
/>

<button data-cy="carousel-next" onClick={next}>
</button>
</div>
);
};

export default BannerCarousel;
1 change: 1 addition & 0 deletions src/components/BannerCarousel/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as BannerCarousel } from './BannerCarousel';
42 changes: 42 additions & 0 deletions src/components/Breadcrumbs/Breadcrumbs.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@use '../../styles/_mixins' as mixins;

@use '../../styles/variables' as vars;

.breadcrumbs {
display: flex;
gap: 8px;
align-items: center;
margin: 24px 0 0;

&_link {
cursor: pointer;

display: flex;
align-items: center;
justify-content: center;

font-family: vars.$font-primary;
font-size: 12px;
font-weight: 600;
color: vars.$secondary-color;

@include mixins.tablet {
font-size: 10px;
}

@include mixins.mobile {
font-size: 8px;
}
}

&_arrow {
display: flex;
align-items: center;
justify-content: center;

img {
width: 16px;
height: 16px;
}
}
}
50 changes: 50 additions & 0 deletions src/components/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Breadcrumbs.tsx
import React from 'react';
import { Link } from 'react-router-dom';
import HomeIcon from '/img/Home.png';
import ChevronIcon from '/img/ChevronRight.png';
import styles from './Breadcrumbs.module.scss';

interface BreadcrumbsProps {
category?: string;
productName?: string;
from: string;
}

export const Breadcrumbs: React.FC<BreadcrumbsProps> = ({
category,
productName,
from,
}) => {
const categoryLabel = category
? category.charAt(0).toUpperCase() + category.slice(1)
: '';

return (
<div className={styles.breadcrumbs}>
<Link to="/" className={styles.breadcrumbs_link}>
<img src={HomeIcon} alt="Home" />
</Link>

{category && (
<>
<span className={styles.breadcrumbs_arrow}>
<img src={ChevronIcon} alt="Chevron" />
</span>
<Link to={from} className={styles.breadcrumbs_link}>
{categoryLabel}
</Link>
</>
)}

{productName && (
<>
<span className={styles.breadcrumbs_arrow}>
<img src={ChevronIcon} alt="Chevron" />
</span>
<span className={styles.breadcrumbs_link}>{productName}</span>
</>
)}
</div>
);
};
Loading