Skip to content
This repository was archived by the owner on Sep 20, 2025. It is now read-only.

Commit e2fb644

Browse files
committed
Handle admin product screen design when product has 1 photo
1 parent 127bd82 commit e2fb644

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

frontend/src/components/pages/adminDashboard/products/ProductComponent.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ export default function ProductComponent() {
3737
}
3838

3939
const renderProductPhotos = () => {
40+
if (1 === state.adminGetProduct.data.photos.length) {
41+
return <img
42+
className="img-fluid product-image"
43+
src={state.adminGetProduct.data.photos[0].path}
44+
/>
45+
}
46+
4047
return <Zoom indicators={indicators}>
4148
{state.adminGetProduct.data.photos.map(({ path, }, index) => (
4249
<div key={index} className="each-slide-effect">

frontend/src/components/pages/adminDashboard/products/ProductComponent.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
margin: 0px auto;
1111
}
1212

13+
.product-image {
14+
max-height: 250px;
15+
max-width: 200px;
16+
margin: 0px auto;
17+
display: flex;
18+
}
19+
1320
.each-slide-effect span {
1421
padding: 20px;
1522
font-size: 20px;

0 commit comments

Comments
 (0)