[PlayerPanel] live 방송일때 ItemCard 예외처리

This commit is contained in:
고동영
2024-05-24 15:02:34 +09:00
parent 53f3e8dfe9
commit ff20d1be59
2 changed files with 15 additions and 19 deletions

View File

@@ -47,9 +47,6 @@ export default memo(function PlayerItemCard({
soldoutFlag,
spotlightId,
patnerName,
startDt,
endDt,
timezone,
liveInfo,
type = TYPES.liveHorizontal,
@@ -59,6 +56,7 @@ export default memo(function PlayerItemCard({
const [percent, setPercent] = useState(0);
useEffect(() => {
if (liveInfo) {
const localStartDt = convertUtcToLocal(liveInfo?.strtDt);
const localEndDt = convertUtcToLocal(liveInfo?.endDt);
const curDt = new Date();
@@ -68,12 +66,13 @@ export default memo(function PlayerItemCard({
const fullSec = localEndSec - localStartSec;
const diff = curSec - localStartSec;
const percent = Math.floor((diff * 100) / fullSec);
let percent = Math.floor((diff * 100) / fullSec);
if (percent > 100) {
percent = 100;
}
setPercent(percent);
}
}, [liveInfo]);
const _onBlur = useCallback(() => {
@@ -132,7 +131,7 @@ export default memo(function PlayerItemCard({
<h3 className={css.brandName}>{patnerName}</h3>
</div>
<h3 className={css.title}>{productName}</h3>
{endDt && startDt && (
{liveInfo && (
<div className={css.progressBarWrap}>
<div className={css.progressBar}>
<div

View File

@@ -53,9 +53,6 @@ export default function LiveChannelContents({
imageSource={thumbnailUrl ? thumbnailUrl : dfltThumbnailImgPath}
productName={showNm}
patnerName={patncNm}
startDt={strtDt}
endDt={endDt}
timezone={timezone}
onClick={handleItemClick}
type={TYPES.liveHorizontal}
spotlightId={`tabChannel-video-${index}`}