Skip to content

Commit 9ae6497

Browse files
committed
some responsive fixes for Product details page
1 parent 5c47499 commit 9ae6497

File tree

5 files changed

+46
-10
lines changed

5 files changed

+46
-10
lines changed

src/Components/ProductDetailsPage/ProductDetails/ProductDealingControls.jsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,24 @@ const ProductDealingControls = () => {
4343
</button>
4444
</div>
4545

46-
<button type="button" className={s.buyButton} onClick={handleBuyProduct}>
47-
Buy Now
48-
</button>
49-
50-
<button type="button" className={s.addToFav} aria-label="Add to favorite">
51-
<SvgIcon name="heart" />
52-
<ToolTip left="50%" top="60px" content="Add to favorite" />
53-
</button>
46+
<div className={s.wrapper}>
47+
<button
48+
type="button"
49+
className={s.buyButton}
50+
onClick={handleBuyProduct}
51+
>
52+
Buy Now
53+
</button>
54+
55+
<button
56+
type="button"
57+
className={s.addToFav}
58+
aria-label="Add to favorite"
59+
>
60+
<SvgIcon name="heart" />
61+
<ToolTip left="50%" top="60px" content="Add to favorite" />
62+
</button>
63+
</div>
5464
</section>
5565
);
5666
};

src/Components/ProductDetailsPage/ProductDetails/ProductDealingControls.module.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
margin: 18px 0 54px;
77
}
88

9+
@media (max-width: 480px) {
10+
.dealing {
11+
flex-direction: column;
12+
}
13+
}
14+
915
.customNumberInput {
1016
display: flex;
1117
align-items: center;
@@ -68,6 +74,12 @@
6874
}
6975
}
7076

77+
.wrapper {
78+
display: flex;
79+
align-items: center;
80+
gap: 20px;
81+
}
82+
7183
.buyButton {
7284
outline: none;
7385
border: none;

src/Components/ProductDetailsPage/ProductDetails/ProductDetails.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { useRef } from "react";
22
import { useSelector } from "react-redux";
33
import ProductPreview from "../ProductPreviw/ProductPreview";
4+
import ProductColorsSection from "./ProductColorsSection";
45
import ProductDealingControls from "./ProductDealingControls";
56
import s from "./ProductDetails.module.scss";
67
import ProductFeatures from "./ProductFeatures";
78
import ProductFirstInfos from "./ProductFirstInfos";
89
import ProductSizes from "./ProductSizes";
9-
import ProductColorsSection from "./ProductColorsSection";
1010

1111
const ProductDetails = ({ data }) => {
1212
const { previewImg, isZoomInPreviewActive } = useSelector(

src/Components/ProductDetailsPage/ProductDetails/ProductDetails.module.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
@include large {
1111
.detailsSection {
12+
height: auto;
1213
flex-direction: column;
1314
align-items: center;
1415
}
@@ -89,5 +90,6 @@
8990
@include large {
9091
.horizontalLine {
9192
max-width: 100%;
93+
min-width: auto;
9294
}
93-
}
95+
}

src/Components/ProductDetailsPage/ProductDetails/ProductFirstInfos.module.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
margin: 10px 0;
1414
}
1515

16+
@include very-small {
17+
.rateAndReviews {
18+
flex-direction: column;
19+
}
20+
}
21+
1622
/* [Stars] */
1723
.rateAndReviews>* {
1824
gap: 6px;
@@ -28,6 +34,12 @@
2834
border-right: solid 2px var(--dark-gray);
2935
}
3036

37+
@include very-small {
38+
.verticalLine {
39+
display: none;
40+
}
41+
}
42+
3143
.greenText {
3244
font-size: .875rem;
3345
color: var(--green);

0 commit comments

Comments
 (0)