LiveChannel , featuruedShows 오픈 시 첫번째 채널에 포커스
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import React, { useCallback, useEffect, useState } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
|
|
||||||
import Spotlight from "@enact/spotlight";
|
|
||||||
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
||||||
|
|
||||||
import TButtonTab, {
|
import TButtonTab, {
|
||||||
@@ -25,8 +24,6 @@ export default function TabContainer({
|
|||||||
shopNowInfo,
|
shopNowInfo,
|
||||||
setSelectedIndex,
|
setSelectedIndex,
|
||||||
liveChannelInfos,
|
liveChannelInfos,
|
||||||
sideOpen,
|
|
||||||
setSideOpen,
|
|
||||||
}) {
|
}) {
|
||||||
const [tab, setTab] = useState(0);
|
const [tab, setTab] = useState(0);
|
||||||
|
|
||||||
@@ -43,10 +40,6 @@ export default function TabContainer({
|
|||||||
[tab]
|
[tab]
|
||||||
);
|
);
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// Spotlight.focus("player-tab-arrow");
|
|
||||||
// }, [sideOpen]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className={css.tabContainer}>
|
<Container className={css.tabContainer}>
|
||||||
<TButtonTab
|
<TButtonTab
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
import React, { useCallback, useState } from "react";
|
import React, {
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
} from 'react';
|
||||||
|
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch } from 'react-redux';
|
||||||
|
|
||||||
import { pushPanel, updatePanel } from "../../../../actions/panelActions";
|
import Spotlight from '@enact/spotlight';
|
||||||
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
|
|
||||||
import { panel_names } from "../../../../utils/Config";
|
import { updatePanel } from '../../../../actions/panelActions';
|
||||||
import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard";
|
import TVirtualGridList
|
||||||
import css from "./LiveChannelContents.module.less";
|
from '../../../../components/TVirtualGridList/TVirtualGridList';
|
||||||
import PlayerTabLoading from "./PlayerTabLoading";
|
import { panel_names } from '../../../../utils/Config';
|
||||||
|
import PlayerItemCard, { TYPES } from '../../PlayerItemCard/PlayerItemCard';
|
||||||
|
import css from './LiveChannelContents.module.less';
|
||||||
|
import PlayerTabLoading from './PlayerTabLoading';
|
||||||
|
|
||||||
export default function FeaturedShowContents({
|
export default function FeaturedShowContents({
|
||||||
featuredShowsInfos,
|
featuredShowsInfos,
|
||||||
@@ -49,11 +55,21 @@ export default function FeaturedShowContents({
|
|||||||
patnerName={patncNm}
|
patnerName={patncNm}
|
||||||
onClick={handleItemClick}
|
onClick={handleItemClick}
|
||||||
type={TYPES.featuredHorizontal}
|
type={TYPES.featuredHorizontal}
|
||||||
|
spotlightId={`featuredShows-video-${index}`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
[featuredShowsInfos]
|
[featuredShowsInfos]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
Spotlight.focus("featuredShows-video-0");
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [featuredShowsInfos]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={css.container}>
|
<div className={css.container}>
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import React, { useCallback, useEffect, useState } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
|
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
|
|
||||||
import { pushPanel, updatePanel } from "../../../../actions/panelActions";
|
import Spotlight from "@enact/spotlight";
|
||||||
|
|
||||||
|
import { updatePanel } from "../../../../actions/panelActions";
|
||||||
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
|
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
|
||||||
import { panel_names } from "../../../../utils/Config";
|
import { panel_names } from "../../../../utils/Config";
|
||||||
import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard";
|
import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard";
|
||||||
@@ -26,10 +28,8 @@ export default function LiveChannelContents({ liveInfos, setSelectedIndex }) {
|
|||||||
endDt,
|
endDt,
|
||||||
timezone,
|
timezone,
|
||||||
thumbnailUrl,
|
thumbnailUrl,
|
||||||
showType,
|
|
||||||
} = liveInfos[index];
|
} = liveInfos[index];
|
||||||
|
|
||||||
console.log("#liveInfos", liveInfos);
|
|
||||||
const handleItemClick = () => {
|
const handleItemClick = () => {
|
||||||
setSelectedIndex(index);
|
setSelectedIndex(index);
|
||||||
|
|
||||||
@@ -55,11 +55,20 @@ export default function LiveChannelContents({ liveInfos, setSelectedIndex }) {
|
|||||||
timezone={timezone}
|
timezone={timezone}
|
||||||
onClick={handleItemClick}
|
onClick={handleItemClick}
|
||||||
type={TYPES.liveHorizontal}
|
type={TYPES.liveHorizontal}
|
||||||
|
spotlightId={`liveChannel-Item-${index}`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
[liveInfos, dispatch]
|
[liveInfos, dispatch]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
Spotlight.focus("liveChannel-Item-0");
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [liveInfos]);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={css.container}>
|
<div className={css.container}>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
|
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
|
|
||||||
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
||||||
|
|
||||||
import { pushPanel, updatePanel } from "../../../../actions/panelActions";
|
import { pushPanel } from "../../../../actions/panelActions";
|
||||||
import TItemCard, { TYPES } from "../../../../components/TItemCard/TItemCard";
|
import TItemCard, { TYPES } from "../../../../components/TItemCard/TItemCard";
|
||||||
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
|
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
|
||||||
import { panel_names } from "../../../../utils/Config";
|
import { panel_names } from "../../../../utils/Config";
|
||||||
@@ -64,6 +64,7 @@ export default function ShopNowContents({ shopNowInfo }) {
|
|||||||
},
|
},
|
||||||
[shopNowInfo]
|
[shopNowInfo]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Container className={css.container}>
|
<Container className={css.container}>
|
||||||
|
|||||||
Reference in New Issue
Block a user