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 #481

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
de02fc4
problem with menu routing
pakhomovalex Aug 13, 2024
0b36a08
problem with menu routing 2
pakhomovalex Aug 13, 2024
c233780
try to deploy
pakhomovalex Aug 14, 2024
7bc5fc8
try again to deploy
pakhomovalex Aug 14, 2024
c2ed547
add catalog
pakhomovalex Aug 16, 2024
6534235
add basic product details with change colors & images
pakhomovalex Aug 21, 2024
f3bc384
add capasity select and description for product
pakhomovalex Aug 22, 2024
713b826
add tablet version for product details & fix some routes, but problem…
pakhomovalex Aug 23, 2024
29133b4
fix image select
pakhomovalex Aug 23, 2024
232ef25
fix routes
pakhomovalex Aug 23, 2024
ace44f7
add loader, add not found phones/table..., pass all tests
pakhomovalex Aug 23, 2024
b4f8960
fix not found page
pakhomovalex Aug 23, 2024
4a92bbd
trying favorite page
pakhomovalex Aug 26, 2024
8e04f03
trying favorite page 2
pakhomovalex Aug 27, 2024
baf6048
trying favorite page 3
pakhomovalex Aug 27, 2024
be995d3
trying favorite page 4
pakhomovalex Aug 27, 2024
f630ce0
add all pictures
pakhomovalex Aug 27, 2024
1d7deae
add working favorite page with too many re-renders
pakhomovalex Aug 28, 2024
c31712c
fix add to card button
pakhomovalex Aug 28, 2024
9c43aaf
complete favorite page without errors, implement zustand libraly
pakhomovalex Aug 28, 2024
1e74101
add design to favorite page & implement favorite function to a Produc…
pakhomovalex Aug 29, 2024
c642c83
add add product to basket and edit there logic
pakhomovalex Aug 30, 2024
ab3a072
fix few problems add final design
pakhomovalex Aug 30, 2024
4649a7f
remove warnings
pakhomovalex Aug 31, 2024
2897fdb
fix problem with overflow in mobile version & add active effect to fa…
pakhomovalex Aug 31, 2024
7adfe4a
fix JSON problem
pakhomovalex Aug 31, 2024
8603488
fix icons in menu
pakhomovalex Aug 31, 2024
1c78aa6
optimisate mobile-desktop screen
pakhomovalex Sep 1, 2024
d5b70ba
some fixes in swipers
pakhomovalex Sep 1, 2024
c51dbc6
update app & add favicon & menu transition & hover efects
pakhomovalex Sep 2, 2024
b5408d7
add favicon
pakhomovalex Sep 2, 2024
39721cc
add hover effect to menu icons
pakhomovalex Sep 2, 2024
3dbf54d
add no-checkout box
pakhomovalex Sep 3, 2024
d2e6508
add my github account link & improve footer logo-link
pakhomovalex Sep 3, 2024
b4af183
fix console bags
pakhomovalex Sep 3, 2024
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
18 changes: 18 additions & 0 deletions public/img/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/img/Menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/img/arrow-next-disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/img/arrow-next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/img/arrow-prev-disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/img/arrow-prev.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/img/arrow-top.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/img/basket-icon.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/img/category-tablets2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/img/close-icon-gray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/img/close-icon.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/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/img/heart-icon-active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/img/heart-icon.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/img/home-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/img/icon-minus-disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/img/icon-minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/img/icon-plus.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 removed public/img/picthree.bdd2e0fc.png
Binary file not shown.
Binary file added public/img/slider-image-tablet.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/slider-image-tablet2.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/img/slider-image-tablet3.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/img/slider-image.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/slider-image2.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/img/slider-image3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 21 additions & 1 deletion src/App.scss
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
// not empty
html {
position: relative;
scroll-behavior: smooth;

&:has(.hidden-overflow) {
overflow: hidden;
}

min-height: 100vh;
}

* button {
cursor: pointer;
}

.not-visible-title {
display: none;
visibility: hidden;
}


55 changes: 50 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,52 @@
/* eslint-disable import/no-extraneous-dependencies */
import { useEffect, useState } from 'react';
import { Desktop } from './utils/DesktopContext';
import { Tablet } from './utils/TabletContext';
import { Outlet } from 'react-router-dom';
import { MenuOpen } from './utils/MenuContext';
import './App.scss';
import classNames from 'classnames';
import { useWindowSize } from 'react-use';
import Favicon from 'react-favicon';

export const App = () => (
<div className="App">
<h1>Product Catalog</h1>
</div>
);
export const App = () => {
const [faviconUrl, setFaviconUrl] = useState('./img/favicon.png');

useEffect(() => setFaviconUrl('./img/favicon.png'), []);

const { width } = useWindowSize();

const [onTablet, setOnTablet] = useState(width >= 640);
const [onDesktop, setOnDesktop] = useState(width >= 1200);

const [isMenuOpen, setIsMenuOpen] = useState(false);

useEffect(() => {
if (width >= 1200) {
setOnDesktop(true);
setOnTablet(false);
setIsMenuOpen(false);
} else if (width >= 640) {
setOnDesktop(false);
setOnTablet(true);
setIsMenuOpen(false);
} else {
setOnDesktop(false);
setOnTablet(false);
}
}, [width]);

return (
<div className={classNames('App', { 'hidden-overflow': isMenuOpen })}>
<Favicon url={faviconUrl} />
<h1 className="not-visible-title">Product Catalog</h1>
<Desktop.Provider value={onDesktop}>
<Tablet.Provider value={onTablet}>
<MenuOpen.Provider value={{ isMenuOpen, setIsMenuOpen }}>
<Outlet />
</MenuOpen.Provider>
</Tablet.Provider>
</Desktop.Provider>
</div>
);
};
File renamed without changes.
4 changes: 2 additions & 2 deletions public/api/phones.json → src/api/phones.json
Original file line number Diff line number Diff line change
Expand Up @@ -5695,12 +5695,12 @@
"id": "apple-iphone-14-pro-256gb-gold",
"category": "phones",
"namespaceId": "apple-iphone-14-pro",
"name": "Apple iPhone 14 Pro 256GB Space Black",
"name": "Apple iPhone 14 Pro 256GB Gold",
"capacityAvailable": ["128GB", "256GB", "512GB", "1TB"],
"capacity": "256GB",
"priceRegular": 1200,
"priceDiscount": 1160,
"colorsAvailable": ["spaceblack", "gold"],
"colorsAvailable": ["gold", "spaceblack"],
"color": "gold",
"images": [
"img/phones/apple-iphone-14-pro/gold/00.webp",
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions src/components/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
101 changes: 101 additions & 0 deletions src/components/BasketItem/BasketItem.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
@import '../../utils/mixins';
@import '../../utils/variables';

.basket-item {
width: 100%;
padding: 16px;
border-radius: 16px;
box-sizing: border-box;
border: 1px solid var(--elements-color);
display: flex;
justify-content: space-between;
flex-direction: column;

@include on-tablet {
flex-direction: row;
}

&__info-box {
display: flex;
align-items: center;
column-gap: 31px;
}

&__remove-button {
width: 16px;
height: 16px;
background-color: var(--white-color);
border: none;
}

&__product-image {
width: 66px;
height: 66px;
object-fit: contain;
}

&__product-name {
font-family: var(--regular-font-family);
font-size: 14px;
font-weight: 500;
line-height: 21px;
letter-spacing: 0%;
}

&__price-count-box {
display: flex;
justify-content: space-between;
align-items: center;
column-gap: 102px;

@include on-tablet {
column-gap: 46px;
}
}

&__count-box {
display: flex;
column-gap: 12px;
align-items: center;
}

&__buttons {
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
border: 1px solid var(--elements-color);
background-color: var(--white-color);
width: 32px;
height: 32px;
transition: .3s;

&:hover {
border-color: var(--dark-gray-color);
}

&--disabled {
pointer-events: none;

&:hover {
border-color: var(--elements-color);
}
}
}

&__counter {
font-family: var(--regular-font-family);
font-size: 14px;
font-weight: 500;
line-height: 21px;
}

&__product-price {
margin: 0;
font-family: var(--strong-font-family);
font-size: 22px;
font-weight: 700;
line-height: 140%;
letter-spacing: 0%;
}
}
Loading
Loading