|
|
|
|
@@ -1,43 +1,29 @@
|
|
|
|
|
import React, {
|
|
|
|
|
useCallback,
|
|
|
|
|
useEffect,
|
|
|
|
|
useMemo,
|
|
|
|
|
useState,
|
|
|
|
|
} from 'react';
|
|
|
|
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
|
|
|
|
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
import {
|
|
|
|
|
useDispatch,
|
|
|
|
|
useSelector,
|
|
|
|
|
} from 'react-redux';
|
|
|
|
|
import classNames from "classnames";
|
|
|
|
|
import { useDispatch, useSelector } from "react-redux";
|
|
|
|
|
|
|
|
|
|
import Spotlight from '@enact/spotlight';
|
|
|
|
|
import SpotlightContainerDecorator
|
|
|
|
|
from '@enact/spotlight/SpotlightContainerDecorator';
|
|
|
|
|
import Spottable from '@enact/spotlight/Spottable';
|
|
|
|
|
import Spotlight from "@enact/spotlight";
|
|
|
|
|
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
|
|
|
|
import Spottable from "@enact/spotlight/Spottable";
|
|
|
|
|
|
|
|
|
|
import playImg from '../../../../../assets/images/btn/btn-play-thumb-nor.png';
|
|
|
|
|
import indicatorDefaultImage
|
|
|
|
|
from '../../../../../assets/images/img-thumb-empty-144@3x.png';
|
|
|
|
|
import defaultImage from '../../../../../assets/images/img-thumb-empty-560.png';
|
|
|
|
|
import playImg from "../../../../../assets/images/btn/btn-play-thumb-nor.png";
|
|
|
|
|
import indicatorDefaultImage from "../../../../../assets/images/img-thumb-empty-144@3x.png";
|
|
|
|
|
import defaultImage from "../../../../../assets/images/img-thumb-empty-560.png";
|
|
|
|
|
import {
|
|
|
|
|
finishVideoPreview,
|
|
|
|
|
startVideoPlayer,
|
|
|
|
|
} from '../../../../actions/playActions';
|
|
|
|
|
import CustomImage from '../../../../components/CustomImage/CustomImage';
|
|
|
|
|
import TVirtualGridList
|
|
|
|
|
from '../../../../components/TVirtualGridList/TVirtualGridList';
|
|
|
|
|
import usePriceInfo from '../../../../hooks/usePriceInfo';
|
|
|
|
|
import useScrollTo from '../../../../hooks/useScrollTo';
|
|
|
|
|
import { panel_names } from '../../../../utils/Config';
|
|
|
|
|
import {
|
|
|
|
|
$L,
|
|
|
|
|
scaleW,
|
|
|
|
|
} from '../../../../utils/helperMethods';
|
|
|
|
|
import css from './Indicator.module.less';
|
|
|
|
|
} from "../../../../actions/playActions";
|
|
|
|
|
import CustomImage from "../../../../components/CustomImage/CustomImage";
|
|
|
|
|
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
|
|
|
|
|
import usePriceInfo from "../../../../hooks/usePriceInfo";
|
|
|
|
|
import useScrollTo from "../../../../hooks/useScrollTo";
|
|
|
|
|
import { panel_names } from "../../../../utils/Config";
|
|
|
|
|
import { $L, scaleW } from "../../../../utils/helperMethods";
|
|
|
|
|
import css from "./Indicator.module.less";
|
|
|
|
|
|
|
|
|
|
const Container = SpotlightContainerDecorator(
|
|
|
|
|
{ enterTo: "last-focused", preserveld: true },
|
|
|
|
|
{ enterTo: "default-element", preserveld: true },
|
|
|
|
|
"div"
|
|
|
|
|
);
|
|
|
|
|
const SpottableComponent = Spottable("div");
|
|
|
|
|
@@ -53,7 +39,9 @@ function Indicator({
|
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
const { cursorVisible } = useSelector((state) => state.common.appStatus);
|
|
|
|
|
const promotionPrcie = usePriceInfo(productInfo?.priceInfo);
|
|
|
|
|
|
|
|
|
|
const isLoading = useSelector(
|
|
|
|
|
(state) => state.common.appStatus?.showLoadingPanel?.show
|
|
|
|
|
);
|
|
|
|
|
const panels = useSelector((state) => state.panels.panels);
|
|
|
|
|
const [autoPlaying, setAutoPlaying] = useState(
|
|
|
|
|
!launchedFromPlayer && productInfo?.prdtMediaUrl
|
|
|
|
|
@@ -171,9 +159,11 @@ function Indicator({
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (selectedIndex === 0) {
|
|
|
|
|
scrollTop();
|
|
|
|
|
scrollTop({
|
|
|
|
|
y: 0,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, [panels, selectedIndex]);
|
|
|
|
|
}, [selectedIndex, isLoading]);
|
|
|
|
|
|
|
|
|
|
const handleVideoOnClick = useCallback(() => {
|
|
|
|
|
if (canPlayVideo) {
|
|
|
|
|
@@ -345,7 +335,7 @@ function Indicator({
|
|
|
|
|
)}
|
|
|
|
|
aria-label="Move to up"
|
|
|
|
|
/>
|
|
|
|
|
<Container className={css.tVirtualGridListContainer}>
|
|
|
|
|
<div className={css.tVirtualGridListContainer}>
|
|
|
|
|
{productInfo && (
|
|
|
|
|
<TVirtualGridList
|
|
|
|
|
cbScrollTo={getScrollTo}
|
|
|
|
|
@@ -358,7 +348,7 @@ function Indicator({
|
|
|
|
|
spotlightId="indicator-GridListContainer"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</Container>
|
|
|
|
|
</div>
|
|
|
|
|
<SpottableComponent
|
|
|
|
|
onClick={handleDownClick}
|
|
|
|
|
spotlightDisabled={!cursorVisible}
|
|
|
|
|
|