[스폰서 이미지 추가]
- 상품 상세 첫번째 이미지에 스폰서 이미지 추가.
This commit is contained in:
@@ -1,14 +1,25 @@
|
|||||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
import React, {
|
||||||
import css from "./ProductDetail.new.module.less";
|
useCallback,
|
||||||
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
|
useEffect,
|
||||||
import Spottable from "@enact/spotlight/Spottable";
|
useMemo,
|
||||||
import CustomImage from "../../../../components/CustomImage/CustomImage";
|
useRef,
|
||||||
import indicatorDefaultImage from "../../../../../assets/images/img-thumb-empty-144@3x.png";
|
useState,
|
||||||
import useScrollTo from "../../../../hooks/useScrollTo";
|
} from 'react';
|
||||||
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
|
||||||
|
import Spotlight from '@enact/spotlight';
|
||||||
|
import SpotlightContainerDecorator
|
||||||
|
from '@enact/spotlight/SpotlightContainerDecorator';
|
||||||
|
import Spottable from '@enact/spotlight/Spottable';
|
||||||
|
|
||||||
|
import indicatorDefaultImage
|
||||||
|
from '../../../../../assets/images/img-thumb-empty-144@3x.png';
|
||||||
|
import CustomImage from '../../../../components/CustomImage/CustomImage';
|
||||||
|
import TVirtualGridList
|
||||||
|
from '../../../../components/TVirtualGridList/TVirtualGridList';
|
||||||
|
import useScrollTo from '../../../../hooks/useScrollTo';
|
||||||
// TVerticalPagenator 제거됨 - TScrollerNew와 충돌 문제로 인해
|
// TVerticalPagenator 제거됨 - TScrollerNew와 충돌 문제로 인해
|
||||||
import { removeSpecificTags } from "../../../../utils/helperMethods";
|
import { removeSpecificTags } from '../../../../utils/helperMethods';
|
||||||
import Spotlight from "@enact/spotlight";
|
import css from './ProductDetail.new.module.less';
|
||||||
|
|
||||||
const Container = SpotlightContainerDecorator(
|
const Container = SpotlightContainerDecorator(
|
||||||
{
|
{
|
||||||
@@ -59,7 +70,8 @@ export default function ProductDetail({ productInfo }) {
|
|||||||
const image = listImages[0] || indicatorDefaultImage;
|
const image = listImages[0] || indicatorDefaultImage;
|
||||||
const imageIndex = productInfo?.imageIndex ?? 0;
|
const imageIndex = productInfo?.imageIndex ?? 0;
|
||||||
const totalImages = productInfo?.totalImages ?? listImages.length;
|
const totalImages = productInfo?.totalImages ?? listImages.length;
|
||||||
|
const sponserImage = productInfo?.spnsrImgUrl;
|
||||||
|
const spnsrNm = productInfo?.spnsrNm;
|
||||||
return (
|
return (
|
||||||
<div className={css.thumbnailWrapper}>
|
<div className={css.thumbnailWrapper}>
|
||||||
<CustomImage
|
<CustomImage
|
||||||
@@ -68,6 +80,19 @@ export default function ProductDetail({ productInfo }) {
|
|||||||
fallbackSrc={indicatorDefaultImage}
|
fallbackSrc={indicatorDefaultImage}
|
||||||
className={css.productImage}
|
className={css.productImage}
|
||||||
/>
|
/>
|
||||||
|
{imageIndex === 0 && sponserImage &&(
|
||||||
|
<div className={css.sponserImgBox}>
|
||||||
|
<CustomImage
|
||||||
|
src={sponserImage}
|
||||||
|
alt={spnsrNm}
|
||||||
|
fallbackSrc={indicatorDefaultImage}
|
||||||
|
className={css.sponserImg}
|
||||||
|
/>
|
||||||
|
<div className={css.sponserTextBox}>
|
||||||
|
SPONSORED BY
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}, [listImages, productInfo?.imageIndex, productInfo?.totalImages]);
|
}, [listImages, productInfo?.imageIndex, productInfo?.totalImages]);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.thumbnailWrapper .productImage {
|
.thumbnailWrapper .productImage {
|
||||||
transform: scale(1.015); // 가로세로 10px 정도 확대 효과
|
transform: scale(1.015); // 가로세로 10px 정도 확대 효과
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,14 +70,15 @@
|
|||||||
|
|
||||||
.thumbnailWrapper {
|
.thumbnailWrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 658px;
|
// width: 658px;
|
||||||
|
width:100%;
|
||||||
height: 610px;
|
height: 610px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.productImage {
|
.productImage {
|
||||||
width: 100%;
|
width: 658px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -89,4 +90,20 @@
|
|||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.sponserImgBox {
|
||||||
|
position:absolute;
|
||||||
|
right:20px;
|
||||||
|
top:20px;
|
||||||
|
.sponserImg {
|
||||||
|
width:145px;
|
||||||
|
}
|
||||||
|
.sponserTextBox {
|
||||||
|
padding: 3px;
|
||||||
|
background-color: #474747;
|
||||||
|
font-size:14px;
|
||||||
|
font-weight:bold;
|
||||||
|
color: rgba(255, 255, 255, 0.5);
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user