Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commit -for fe-chat problem with swiper #196

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
248 changes: 187 additions & 61 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,28 @@
"license": "GPL-3.0",
"dependencies": {
"@cypress/react": "^5.12.4",
"@reduxjs/toolkit": "^1.9.5",
"@types/react-redux": "^7.1.25",
"bulma": "^0.9.3",
"classnames": "^2.3.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^8.1.1",
"react-router-dom": "^6.14.2",
"react-scripts": "^4.0.3"
},
"devDependencies": {
"@cypress/webpack-dev-server": "^1.8.4",
"@mate-academy/cypress-tools": "^1.0.4",
"@mate-academy/eslint-config-react": "*",
"@mate-academy/eslint-config-react-typescript": "*",
"@mate-academy/scripts": "^1.2.1",
"@mate-academy/scripts": "^1.2.8",
"@mate-academy/students-ts-config": "*",
"@mate-academy/stylelint-config": "*",
"@types/node": "^17.0.23",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@types/react-dom": "^18.2.7",
"@types/react-slick": "^0.23.10",
"cypress": "^9.5.3",
"eslint": "^7.32.0",
"eslint-plugin-cypress": "^2.11.2",
Expand Down
Binary file added public/images/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 public/images/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 public/images/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.
5 changes: 5 additions & 0 deletions public/images/icons/ArrowDown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/ArrowLeft-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/ArrowLeft.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/ArrowRight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/ArrowUp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/ArrowUpDark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/CloseButton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/CloseButtonDark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/HeartLike.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/HeartLikeFilled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/images/icons/Home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/icons/Search.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 public/images/icons/ShoppingbagCart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/images/icons/icon-burger-menu-hover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/images/icons/icon-burger-menu.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 public/images/icons/icon-close.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 public/images/logo.jpg
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/images/preview-category-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 public/images/preview-category-phone.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/images/preview-category-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 public/images/product-card-img.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/category-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 public/img/category-phones.png
Binary file added public/img/category-tablets.png
Binary file added public/img/phones/apple-iphone-11-pro/gold/00.jpg
Binary file added public/img/phones/apple-iphone-11-pro/gold/01.jpg
Binary file added public/img/phones/apple-iphone-11-pro/gold/02.jpg
Binary file added public/img/phones/apple-iphone-11/black/00.jpg
Binary file added public/img/phones/apple-iphone-11/black/01.jpg
Binary file added public/img/phones/apple-iphone-11/black/02.jpg
Binary file added public/img/phones/apple-iphone-11/black/03.jpg
Binary file added public/img/phones/apple-iphone-11/black/04.jpg
Binary file added public/img/phones/apple-iphone-11/green/00.jpg
Binary file added public/img/phones/apple-iphone-11/green/01.jpg
Binary file added public/img/phones/apple-iphone-11/green/02.jpg
Binary file added public/img/phones/apple-iphone-11/green/03.jpg
Binary file added public/img/phones/apple-iphone-11/green/04.jpg
Binary file added public/img/phones/apple-iphone-11/purple/00.jpg
Binary file added public/img/phones/apple-iphone-11/purple/01.jpg
Binary file added public/img/phones/apple-iphone-11/purple/02.jpg
Binary file added public/img/phones/apple-iphone-11/purple/03.jpg
Binary file added public/img/phones/apple-iphone-11/purple/04.jpg
Binary file added public/img/phones/apple-iphone-11/red/00.jpg
Binary file added public/img/phones/apple-iphone-11/red/01.jpg
Binary file added public/img/phones/apple-iphone-11/red/02.jpg
Binary file added public/img/phones/apple-iphone-11/red/03.jpg
Binary file added public/img/phones/apple-iphone-11/red/04.jpg
Binary file added public/img/phones/apple-iphone-11/white/00.jpg
Binary file added public/img/phones/apple-iphone-11/white/01.jpg
Binary file added public/img/phones/apple-iphone-11/white/02.jpg
Binary file added public/img/phones/apple-iphone-11/white/03.jpg
Binary file added public/img/phones/apple-iphone-11/white/04.jpg
Binary file added public/img/phones/apple-iphone-11/yellow/00.jpg
Binary file added public/img/phones/apple-iphone-11/yellow/01.jpg
Binary file added public/img/phones/apple-iphone-11/yellow/02.jpg
Binary file added public/img/phones/apple-iphone-11/yellow/03.jpg
Binary file added public/img/phones/apple-iphone-7-plus/gold/00.jpg
Binary file added public/img/phones/apple-iphone-7-plus/gold/01.jpg
Binary file added public/img/phones/apple-iphone-7-plus/gold/02.jpg
Binary file added public/img/phones/apple-iphone-7-plus/gold/04.jpg
Binary file added public/img/phones/apple-iphone-7/black/00.jpg
Binary file added public/img/phones/apple-iphone-7/black/01.jpg
Binary file added public/img/phones/apple-iphone-7/black/02.jpg
Binary file added public/img/phones/apple-iphone-7/black/03.jpg
Binary file added public/img/phones/apple-iphone-7/black/04.jpg
Binary file added public/img/phones/apple-iphone-7/gold/00.jpg
Binary file added public/img/phones/apple-iphone-7/gold/01.jpg
Binary file added public/img/phones/apple-iphone-7/gold/02.jpg
Binary file added public/img/phones/apple-iphone-7/gold/03.jpg
Binary file added public/img/phones/apple-iphone-7/gold/04.jpg
Binary file added public/img/phones/apple-iphone-7/rosegold/00.jpg
Binary file added public/img/phones/apple-iphone-7/rosegold/01.jpg
Binary file added public/img/phones/apple-iphone-7/rosegold/03.jpg
Binary file added public/img/phones/apple-iphone-7/rosegold/04.jpg
Binary file added public/img/phones/apple-iphone-7/silver/00.jpg
Binary file added public/img/phones/apple-iphone-7/silver/01.jpg
Binary file added public/img/phones/apple-iphone-7/silver/02.jpg
Binary file added public/img/phones/apple-iphone-7/silver/03.jpg
Binary file added public/img/phones/apple-iphone-7/silver/04.jpg
Binary file added public/img/phones/apple-iphone-8/gold/00.jpg
Binary file added public/img/phones/apple-iphone-8/gold/01.jpg
Binary file added public/img/phones/apple-iphone-8/gold/02.jpg
Binary file added public/img/phones/apple-iphone-8/gold/03.jpg
Binary file added public/img/phones/apple-iphone-8/silver/00.jpg
Binary file added public/img/phones/apple-iphone-8/silver/01.jpg
Binary file added public/img/phones/apple-iphone-8/silver/02.jpg
Binary file added public/img/phones/apple-iphone-8/silver/03.jpg
Binary file added public/img/phones/apple-iphone-8/spacegray/00.jpg
Binary file added public/img/phones/apple-iphone-8/spacegray/01.jpg
Binary file added public/img/phones/apple-iphone-8/spacegray/03.jpg
Binary file added public/img/phones/apple-iphone-xr/coral/00.jpg
Binary file added public/img/phones/apple-iphone-xr/coral/01.jpg
Binary file added public/img/phones/apple-iphone-xr/coral/02.jpg
Binary file added public/img/phones/apple-iphone-xr/red/00.jpg
Binary file added public/img/phones/apple-iphone-xr/red/01.jpg
Binary file added public/img/phones/apple-iphone-xr/red/02.jpg
Binary file added public/img/phones/apple-iphone-xr/red/03.jpg
Binary file added public/img/phones/apple-iphone-xr/red/04.jpg
Binary file added public/img/phones/apple-iphone-xr/white/00.jpg
Binary file added public/img/phones/apple-iphone-xr/white/01.jpg
Binary file added public/img/phones/apple-iphone-xr/white/02.jpg
Binary file added public/img/phones/apple-iphone-xr/white/03.jpg
Binary file added public/img/phones/apple-iphone-xr/yellow/00.jpg
Binary file added public/img/phones/apple-iphone-xr/yellow/01.jpg
Binary file added public/img/phones/apple-iphone-xr/yellow/02.jpg
Binary file added public/img/phones/apple-iphone-xr/yellow/03.jpg
Binary file added public/img/phones/apple-iphone-xr/yellow/04.jpg
Binary file added public/img/phones/apple-iphone-xs-max/gold/00.jpg
Binary file added public/img/phones/apple-iphone-xs-max/gold/02.jpg
Binary file added public/img/phones/apple-iphone-xs-max/gold/04.jpg
Binary file added public/img/phones/apple-iphone-xs/gold/00.jpg
Binary file added public/img/phones/apple-iphone-xs/gold/01.jpg
Binary file added public/img/phones/apple-iphone-xs/gold/02.jpg
Binary file added public/img/phones/apple-iphone-xs/gold/03.jpg
Binary file added public/img/phones/apple-iphone-xs/gold/04.jpg
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added public/img/picthree.bdd2e0fc.png
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="images/banner-phones.png" />
<title>Phone catalog</title>
</head>
<body>
Expand Down
31 changes: 30 additions & 1 deletion src/App.scss
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
// not empty
@font-face {
font-family: Mont-Regular;
src: url("../src/fonts/Mont-Regular.otf") format("truetype");
}
@font-face {
font-family: Mont-SemiBold;
src: url("../src/fonts/Mont-SemiBold.otf") format("truetype");
}
@font-face {
font-family: Mont-Bold;
src: url("../src/fonts/Mont-Bold.otf") format("truetype");
}

html,
body {
margin: 0;
scroll-behavior: smooth;
}

button {
cursor: pointer;
}

.App {
font-family: Mont-Regular, Arial, Helvetica, sans-serif;
overflow: hidden;
display: flex;
flex-direction: column;
min-height: 100vh;
}
150 changes: 144 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,147 @@
import { FC, useEffect } from 'react';
import {
Navigate, Route, Routes, useLocation,
} from 'react-router-dom';
import './App.scss';

const App = () => (
<div className="App">
<h1>React Phone Catalog</h1>
</div>
);
import { Header } from './pages/components/Header';
import { HomePage } from './pages/HomePage';
import { PhonesPage } from './pages/PhonesPage';
import { Footer } from './pages/components/Footer';
import { ProductDetailsPage } from './pages/ProductDetailsPage';
import { useAppDispatch, useAppSelector } from './app/hooks';
import { incrementAsync as loadedPhones } from './features/phones/phonesSlice';
import { FavoritesPage } from './pages/FavoritesPage';
import { CardPage } from './pages/CardPage';
import { TabletsPage } from './pages/TabletsPage';
import {
incrementAsync as loadedProducts,
} from './features/products/productsSlice';
import { AccessoriesPage } from './pages/AccessoriesPage';
import { searchBarSelector } from './app/selector';
import { unsetSearchingValue } from './features/SearchBar/searchBarSlice';

export default App;
export const App: FC = () => {
const dispatch = useAppDispatch();
const locationPathName = useLocation().pathname;
const searchBarValue = useAppSelector(searchBarSelector);

useEffect(() => {
if (searchBarValue) {
dispatch(unsetSearchingValue());
}
}, [locationPathName]);

useEffect(() => {
dispatch(loadedPhones());
dispatch(loadedProducts());
}, []);

return (
<div className="App">
<Routes>
<Route
path="/"
element={(
<>
<Header />
<HomePage />
<Footer />
</>
)}
/>
<Route path="home" element={<Navigate to="/" replace />} />
<Route path="phones">
<Route
index
element={(
<>
<Header />
<PhonesPage />
<Footer />
</>
)}
/>
<Route
path="/phones/:productId"
element={(
<>
<Header />
<ProductDetailsPage />
<Footer />
</>
)}
/>
</Route>
<Route path="tablets">
<Route
index
element={(
<>
<Header />
<TabletsPage />
<Footer />
</>
)}
/>
<Route
path="/tablets/:productId"
element={(
<>
<Header />
<ProductDetailsPage />
<Footer />
</>
)}
/>
</Route>
<Route path="accessories">
<Route
index
element={(
<>
<Header />
<AccessoriesPage />
<Footer />
</>
)}
/>
<Route
path="/accessories/:productId"
element={(
<>
<Header />
<ProductDetailsPage />
<Footer />
</>
)}
/>
</Route>
<Route
path="favorites"
element={(
<>
<Header />
<FavoritesPage />
<Footer />
</>
)}
/>
<Route
path="card"
element={(
<>
<Header />
<CardPage />
<Footer />
</>
)}
/>
<Route
path="*"
element={<h1 className="title">Page not found</h1>}
/>
</Routes>
</div>
);
};
Loading
Loading