Skip to content

Commit

Permalink
Merge pull request #50 from fs-mar24-codemafia/fix/cartPage
Browse files Browse the repository at this point in the history
fix cart
  • Loading branch information
denyssheremeta authored Jun 14, 2024
2 parents f76867f + 012c70c commit 0f4abdd
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 17 deletions.
56 changes: 49 additions & 7 deletions src/pages/CartPage/CartItem/CartItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@

&__product-link {
display: flex;
flex-basis: 25%;
// flex-basis: 25%;
text-decoration: none;

&--name {
flex-basis: 60%;
// flex-basis: 60%;

@include on-mobile {
// flex-basis: 45%
}
}
}

Expand All @@ -68,26 +72,64 @@
&:hover {
text-decoration: underline;
}
@include on-mobile {
// flex-basis: 100%;
}
}

&__count-buttons {
margin-right: 40px;
// margin-right: 40px;
width: 96px;
height: 32px;
display: flex;
display: grid;
justify-content: space-between;
align-items: center;
gap: 14px;
// gap: 14px;
flex-direction: column;
grid-template-columns: 1fr 32px 1fr;
justify-items: center;
@include body-text;
}
}

&__button {
width: 32px;
min-width: 32px;
height: 100%;
background-color: var(--color-white);
}

&__price {
min-width: 90px;
@include h3;

@include on-mobile {
text-align: end;
}
}
.sum {
width: 50%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
gap: 16px;
@include on-mobile {
width: 100%;
// gap: 16px;
// justify-content: space-between;
}
}
.gadget {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
gap: 24px;
@include on-mobile {
// width: 100%;
gap: 16px;
}
}
}
9 changes: 9 additions & 0 deletions src/pages/CartPage/CartItem/CartItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const CartItem: React.FC<Props> = ({
}) => {
return (
<div className="cart-item">
<div className="gadget">
<button
type="button"
aria-label="delete button"
Expand All @@ -50,6 +51,12 @@ export const CartItem: React.FC<Props> = ({
>
<h2 className="cart-item__name">{product.name}</h2>
</Link>
</div>



<div className="sum">

<div className="cart-item__count-buttons">
<button
type="button"
Expand All @@ -69,6 +76,8 @@ export const CartItem: React.FC<Props> = ({
/>
</div>
<span className="cart-item__price">${product.price * quantity}</span>

</div>
</div>
);
};
20 changes: 10 additions & 10 deletions src/pages/CartPage/CartPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@
text-align: center;
}

&__items-count {
padding-bottom: 24px;
margin-bottom: 24px;
border-bottom: 1px solid var(--color-elements);
color: var(--color-secondary);
font-size: 14px;
font-weight: 500;
line-height: 21px;
text-align: center;
}
&__items-count {
padding-bottom: 24px;
margin-bottom: 24px;
border-bottom: 1px solid var(--color-elements);
color: var(--color-secondary);
font-size: 14px;
font-weight: 500;
line-height: 21px;
text-align: center;
}

&__checkout {
display: flex;
Expand Down

0 comments on commit 0f4abdd

Please sign in to comment.