Skip to content

Commit

Permalink
edits
Browse files Browse the repository at this point in the history
  • Loading branch information
LBondarchuk committed Jul 19, 2023
1 parent 8be1483 commit d0f992e
Show file tree
Hide file tree
Showing 24 changed files with 72 additions and 53 deletions.
4 changes: 3 additions & 1 deletion src/components/Categories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export const Categories:React.FC<Props> = memo(({ itemsLength }) => {
key={categorie}
>
<img src={`img/${categorie}.png`} alt={`${categorie} foto`} />
<div className="categories__item--title">{categorie}</div>
<div className="categories__item--title">
{categorie[0].toUpperCase() + categorie.slice(1)}
</div>
<div className="categories__item--total-amount">
{`${categorie === categories[0] ? itemsLength : 0} models` }
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export const Nav:React.FC<Props> = ({ items }) => {
className={
classnames(
'nav__item', {
'nav__item--active': item === pathname.slice(1)
'nav__item--active': item.toLowerCase() === pathname.slice(1)
|| (item === 'home' && pathname === '/'),
},
)
}
>
<Link to={`${linkPath(item)}`}>{item}</Link>
<Link to={`${linkPath(item.toLowerCase())}`}>{item}</Link>
</li>
))}
</ul>
Expand Down
6 changes: 3 additions & 3 deletions src/components/PageNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ export const PageNavigation = () => {
/>
</div>
{item === pathNames[pathNames.length - 1]
? <span key={item}>{item}</span>
? <span key={item}>{item[0].toUpperCase() + item.slice(1)}</span>
: (
<Link
to={`/${pathNames.slice(0, pathNames.indexOf(item) + 1).join('/')}`}
>
{item}
{item[0].toUpperCase() + item.slice(1)}
</Link>
)}
</>
))}
</div>
<Link to={prevPath || '/'} className="page__navigation--go-back">
<img src="assests/images/Arrow-left.svg" alt="icon-left" />
<span data-cy="backButton">back</span>
<span data-cy="backButton">Back</span>
</Link>
</nav>
);
Expand Down
20 changes: 10 additions & 10 deletions src/components/TopActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ export const TopActions = () => {

return (
<div className="top-actions">
<div className="icon icon-info">
<Link to="/favourites" className="icon icon-info">
{favourites.length > 0
&& <div className="icon-info__info">{favourites.length}</div>}
<Link to="/favourites">
<img src="assests/images/Favourites.svg" alt="heart icon" />
</Link>
</div>
<div className="icon icon-info">

<img src="assests/images/Favourites.svg" alt="heart icon" />
</Link>

<Link to="/cart" className="icon icon-info">
{cartList.length > 0
&& <div className="icon-info__info">{cartList.length}</div>}
<Link to="/cart">
<img src="assests/images/Cart.svg" alt="cart icon" />
</Link>
</div>

<img src="assests/images/Cart.svg" alt="cart icon" />
</Link>

</div>
);
};
2 changes: 1 addition & 1 deletion src/components/pages/CartPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const CartPage: React.FC = () => {
<div className="cart__total">
<div className="cart__total--amount">
<h1>{`$${totalAmount}`}</h1>
<p>{`Total for ${cartList.length} items`}</p>
<p>{`Total for ${cartList.reduce((acum, { quantity }) => acum + quantity, 0)} items`}</p>
</div>
{cartList.length > 0 && (
<button
Expand Down
2 changes: 1 addition & 1 deletion src/scss/categories/categories-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}

&--title {
@include text(20px, 600, $primary-dark-color);
@include text(20px, 500, $primary-dark-color);
text-decoration: none;
}

Expand Down
1 change: 1 addition & 0 deletions src/scss/categories/categories.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

&__title {
@include text (32px, 700, $primary-dark-color);
font-style: normal;
}

&__items {
Expand Down
4 changes: 2 additions & 2 deletions src/scss/characteristic-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
margin-bottom: 8px;

&--name {
@include text(12px, 600, $primary-gray-color);
@include text(12px, 500, $primary-gray-color);
}

&--characteristic {
position: relative;
@include text(12px, 600, $primary-dark-color);
@include text(12px, 500, $primary-dark-color);
bottom: 0;
}
}
Expand Down
20 changes: 20 additions & 0 deletions src/scss/fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@font-face {
font-family: "Mont";
src: url("../fonts/Mont-Regular.otf");
font-style: normal;
font-weight: 400;
}

@font-face {
font-family: "Mont";
src: url("../fonts/Mont-Bold.otf");
font-style: normal;
font-weight: 700;
}

@font-face {
font-family: "Mont";
src: url("../fonts/Mont-SemiBold.otf");
font-style: normal;
font-weight: 500;
}
2 changes: 1 addition & 1 deletion src/scss/footer/footer-actions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

&--description {
@include text(12px, 600, $primary-gray-color);
@include text(12px, 500, $primary-gray-color);
@include onPhone {
font-size: 14px;
}
Expand Down
8 changes: 1 addition & 7 deletions src/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@
@import "./utils/reset.scss";
@import "./error.scss";
@import "./characteristic-item.scss";

@font-face {
font-family: "Mont";
src: local("Mont-Regular"), url("../fonts/Mont-Regular.otf") format("woff");
src: local("Mont-Bold"), url("../fonts/Mont-Bold.otf") format("woff");
src: local("Mont-SemiBold"), url("../fonts/Mont-SemiBold.otf") format("woff");
}
@import "./fonts.scss";

.App {
min-height: 100vh;
Expand Down
1 change: 0 additions & 1 deletion src/scss/logo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

.logo {
@extend .flex-center;
@include text(150%, 900, $primary-dark-color);
z-index: 1;
}
21 changes: 11 additions & 10 deletions src/scss/nav/nav-item.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
@import "../utils/variables";
@import "../utils/mixins";
@import "../utils/extends";

.nav {
&__item {
position: relative;
top: 3px;
display: inline-block;
align-items: center;
height: 86%;
width: fit-content;
border-bottom: 3px solid transparent;

& a {
@include text(12px, 700, $primary-gray-color);
@extend .flex-center;
align-items: center;
@include text(12px, 700, $primary-gray-color);
letter-spacing: 0.48px;
transition: color 0.1s;
text-transform: uppercase;
height: 100%;

&:hover {
opacity: 0.5;
Expand All @@ -21,15 +30,7 @@
}

&--active {
&:after {
position: relative;
top: 21px;
content: "";
display: block;
height: 3px;
background: $primary-dark-color;
border-radius: 2px;
}
border-color: $primary-dark-color;
}
}
}
6 changes: 3 additions & 3 deletions src/scss/page-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
}

& span {
@include text (12px, 600, $primary-gray-color);
@include text (12px, 500, $primary-gray-color);
}
}

&--text {
@include text(12px, 600, $primary-gray-color);
@include text(12px, 500, $primary-gray-color);
}

&--go-back {
display: flex;
gap: 8px;

& span {
@include text(12px, 600, $primary-gray-color);
@include text(12px, 500, $primary-gray-color);
}
}
}
4 changes: 2 additions & 2 deletions src/scss/pages/cart-page/cart-total.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
& button {
width: 100%;
@extend .flex-center;
@include text(14px, 500, #fff);
@include text(14px, 600, #fff);
padding: 14px;
background: $primary-dark-color;
color: #fff;
Expand All @@ -64,7 +64,7 @@
}

& span {
@include text (14px, 600, $primary-gray-color);
@include text (14px, 500, $primary-gray-color);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/scss/pages/product-details-page/details-about.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

&--title {
margin-bottom: 16px;
@include text(20px, 600, $primary-dark-color);
@include text(20px, 500, $primary-dark-color);
}

&--description {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
margin: 0;
margin-bottom: 9px;
padding: 0;
@include text(12px, 600, $primary-gray-color);
@include text(12px, 500, $primary-gray-color);
}

&--list {
Expand Down
2 changes: 1 addition & 1 deletion src/scss/product-card/price.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

&--without-discont {
@include text(22px, 700, $primary-gray-color);
@include text(22px, 500, $primary-gray-color);
margin-left: 8px;
text-decoration-line: line-through;
}
Expand Down
1 change: 1 addition & 0 deletions src/scss/product-card/title.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
margin-bottom: 8px;
@include text(14px, 500, $primary-dark-color);
width: 100%;


&:hover {
opacity: 0.7;
Expand Down
2 changes: 1 addition & 1 deletion src/scss/search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
width: 327px;

&::placeholder {
@include text (14px, 600, $primary-gray-color);
@include text (14px, 500, $primary-gray-color);
}

@include onTab {
Expand Down
2 changes: 1 addition & 1 deletion src/scss/select-block/item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.filter {
&__item {
@include text(14px, 600, $primary-gray-color );
@include text(14px, 500, $primary-gray-color );
padding: 10px 16px;
cursor: pointer;
transition: box-shadow 0.2s ease;
Expand Down
2 changes: 1 addition & 1 deletion src/scss/select-block/select-block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

&__description {
@include text(12px, 600, $primary-gray-color);
@include text(12px, 500, $primary-gray-color);
margin-bottom: 4px;
}

Expand Down
2 changes: 1 addition & 1 deletion src/scss/select-block/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

& span {
@include text(14px, 600, $primary-dark-color);
@include text(14px, 500, $primary-dark-color);
}
}
}
5 changes: 3 additions & 2 deletions src/scss/utils/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@mixin text($size, $width, $color) {
@mixin text($size, $weight, $color) {
font-size: $size;
font-weight: $width;
font-weight: $weight;
color: $color;
font-family: "Mont", sans-serif;

}

@mixin onTab {
Expand Down

0 comments on commit d0f992e

Please sign in to comment.