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

Develop #485

Open
wants to merge 14 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
  •  
  •  
  •  
36 changes: 23 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
"classnames": "^2.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
"react-router-dom": "^6.22.3",
"react-scripts": "5.0.1",
"react-transition-group": "^4.4.5"
"react-transition-group": "^4.4.5",
"swiper": "^11.1.5"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@mate-academy/eslint-config-react-typescript": "latest",
"@mate-academy/scripts": "^1.7.9",
"@mate-academy/scripts": "^1.8.5",
"@mate-academy/students-ts-config": "latest",
"@mate-academy/stylelint-config": "latest",
"@types/node": "^16.18.80",
Expand Down
2 changes: 1 addition & 1 deletion public/api/products.json
Original file line number Diff line number Diff line change
Expand Up @@ -2715,4 +2715,4 @@
"year": 2022,
"image": "img/phones/apple-iphone-14-pro/gold/00.webp"
}
]
]
25 changes: 25 additions & 0 deletions public/img/logos/mainlogo.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: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="img/logos/mainlogo.svg" ba />
<title>Phone catalog</title>
</head>
<body>
Expand Down
21 changes: 20 additions & 1 deletion src/App.scss
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
// not empty
:root {
--swiper-pagination-color: #0f0f11;
--swiper-pagination-bullet-width: 14px;
--swiper-pagination-bullet-height: 4px;
--swiper-pagination-bullet-border-radius: 0;
--swiper-pagination-bullet-inactive-color: #828587;
}

.App {
display: flex;
flex-direction: column;
min-height: 100vh;

&__content {
max-width: 1200px;
width: 100%;
margin: 0 auto;
flex: 1;
}
}
19 changes: 14 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { Outlet } from 'react-router-dom';
import './App.scss';
import { TopBar } from './components/TopBar';
import { Footer } from './components/Footer';

export const App = () => (
<div className="App">
<h1>Product Catalog</h1>
</div>
);
export const App = () => {
return (
<div className="App">
<TopBar />
<div className="App__content">
<Outlet />
</div>
<Footer />
</div>
);
};
56 changes: 56 additions & 0 deletions src/Root.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import {
HashRouter as Router,
Routes,
Route,
Navigate,
} from 'react-router-dom';
import { App } from './App';
import { HomePage } from './modules/HomePage';
import { NotFoundPage } from './modules/NotFoundPage';
import { FavouritesPage } from './modules/FavouritesPage';
import { CartPage } from './modules/CartPage';
import { MenuProvider } from './store/MenuProvider';
import { CatalogPage } from './modules/CatalogPage/CatalogPage';
import { ProductProvider } from './store/ProductProvider';
import { FavouritesProvider } from './store/FavouritesProvider';
import { CartProvider } from './store/CartProvider';
import { ItemCardPage } from './modules/ItemCardPage/ItemCardPage';

export const Root = () => (
<ProductProvider>
<FavouritesProvider>
<CartProvider>
<MenuProvider>
<Router>
<Routes>
<Route path="/" element={<App />}>
<Route index element={<HomePage />} />
<Route path="home" element={<Navigate to={'/'} replace />} />
<Route path="phones">
<Route index element={<CatalogPage category="phones" />} />
<Route path={':productId'} element={<ItemCardPage />} />
</Route>
<Route path="tablets">
<Route index element={<CatalogPage category="tablets" />} />
<Route path={':productId'} element={<ItemCardPage />} />
</Route>
<Route path="accessories">
<Route
index
element={<CatalogPage category="accessories" />}
/>
<Route path={':productId'} element={<ItemCardPage />} />
</Route>

<Route path="favourites" element={<FavouritesPage />} />
<Route path="cart" element={<CartPage />} />

<Route path="*" element={<NotFoundPage />} />
</Route>
</Routes>
</Router>
</MenuProvider>
</CartProvider>
</FavouritesProvider>
</ProductProvider>
);
Loading
Loading