[FeaturedBrandsPanel] import React

Detail Notes :

1. React 부재로 인한 오류로 인한 React import
This commit is contained in:
younghoon100.park
2024-02-05 20:37:05 +09:00
parent 9ea37a7c84
commit abcd7ab5bd
3 changed files with 38 additions and 13 deletions

View File

@@ -1,3 +1,5 @@
import React from "react";
import Scroller from "@enact/sandstone/Scroller"; import Scroller from "@enact/sandstone/Scroller";
import SectionTitle from "../../../components/SectionTitle/SectionTitle"; import SectionTitle from "../../../components/SectionTitle/SectionTitle";

View File

@@ -1,4 +1,4 @@
import { memo, useCallback, useState } from "react"; import React, { memo, useCallback, useState } from "react";
import Spottable from "@enact/spotlight/Spottable"; import Spottable from "@enact/spotlight/Spottable";
@@ -54,7 +54,13 @@ export default memo(function LiveVideoCard({
<div> <div>
<div> <div>
<img src={IcLiveShow} alt={LIVE_SHOW_STRING} /> <img
src={IcLiveShow}
alt={
// @@pyh Todo, alt 값 언어처리 유무
LIVE_SHOW_STRING
}
/>
<div> <div>
<h3>{title}</h3> <h3>{title}</h3>
<time> <time>
@@ -64,7 +70,13 @@ export default memo(function LiveVideoCard({
</div> </div>
{liveChannelCount && liveChannelCount === 1 && ( {liveChannelCount && liveChannelCount === 1 && (
<div> <div>
<img src={IcWarning} alt={WARNING_STRING} /> <img
src={IcWarning}
alt={
// @@pyh Todo, alt 값 언어처리 유무
WARNING_STRING
}
/>
<span>{$L(WARNING_MESSAGE)}</span> <span>{$L(WARNING_MESSAGE)}</span>
</div> </div>
)} )}

View File

@@ -1,11 +1,12 @@
import React, { useEffect } from "react"; import React, { useEffect } from 'react';
import Spotlight from "@enact/spotlight"; import Spotlight from '@enact/spotlight';
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator"; import SpotlightContainerDecorator
import Spottable from "@enact/spotlight/Spottable"; from '@enact/spotlight/SpotlightContainerDecorator';
import Spottable from '@enact/spotlight/Spottable';
import { $L } from "../../../utils/helperMethods"; import { $L } from '../../../utils/helperMethods';
import css from "./QuickMenu.module.less"; import css from './QuickMenu.module.less';
const Container = SpotlightContainerDecorator( const Container = SpotlightContainerDecorator(
{ leaveFor: { right: "" }, enterTo: "last-focused" }, { leaveFor: { right: "" }, enterTo: "last-focused" },
@@ -14,7 +15,12 @@ const Container = SpotlightContainerDecorator(
const SpottableComponent = Spottable("li"); const SpottableComponent = Spottable("li");
export default function QuickMenu({ brandInfo, selectedPatnrId, onQuickMenuClick, ...rest }) { export default function QuickMenu({
brandInfo,
selectedPatnrId,
onQuickMenuClick,
...rest
}) {
const handleClick = (patnrId) => { const handleClick = (patnrId) => {
if (selectedPatnrId === patnrId) { if (selectedPatnrId === patnrId) {
return; return;
@@ -24,9 +30,11 @@ export default function QuickMenu({ brandInfo, selectedPatnrId, onQuickMenuClick
}; };
useEffect(() => { useEffect(() => {
const element = document.getElementById(selectedPatnrId); console.log("@@ brandInfo", brandInfo);
// @@pyh Todo, change to logic
// const element = document.getElementById(selectedPatnrId);
Spotlight.focus(element); Spotlight.focus("spotlight" + selectedPatnrId);
}, []); }, []);
return ( return (
@@ -40,8 +48,11 @@ export default function QuickMenu({ brandInfo, selectedPatnrId, onQuickMenuClick
id={patnrId} id={patnrId}
key={patnrId} key={patnrId}
onClick={() => handleClick(patnrId)} onClick={() => handleClick(patnrId)}
spotlightId={"spotlight" + patnrId}
> >
{newFlag === "Y" && <span className={css.newBagde}>{$L("NEW")}</span>} {newFlag === "Y" && (
<span className={css.newBagde}>{$L("NEW")}</span>
)}
<span className={css.outline} /> <span className={css.outline} />
<img src={logoImgPath} alt={logoImgAlt} /> <img src={logoImgPath} alt={logoImgAlt} />
</SpottableComponent> </SpottableComponent>