[HomePanel] 파일구조 변경 및 에러 수정

- 파일구조변경.
- PopularShow 부분 의존성 배열 추가.
This commit is contained in:
junghoon86.park
2024-02-07 10:22:31 +09:00
parent 9d5b02eb54
commit 0cb6005891
12 changed files with 34 additions and 40 deletions

View File

@@ -11,8 +11,8 @@ import ri from "@enact/ui/resolution";
import SectionTitle from "../../../components/SectionTitle/SectionTitle"; import SectionTitle from "../../../components/SectionTitle/SectionTitle";
import TGrid from "../../../components/TGrid/TGrid"; import TGrid from "../../../components/TGrid/TGrid";
import { $L } from "../../../utils/helperMethods"; import { $L } from "../../../utils/helperMethods";
import BestSellerItem from "../BestSellerItem/BestSellerItem";
import css from "./BestSeller.module.less"; import css from "./BestSeller.module.less";
import BestSellerItem from "./BestSellerItem/BestSellerItem";
const Container = SpotlightContainerDecorator( const Container = SpotlightContainerDecorator(
{ enterTo: "last-focused", leaveFor: { left: "", right: "" } }, { enterTo: "last-focused", leaveFor: { left: "", right: "" } },

View File

@@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import TItemCard from "../../../components/TItemCard/TItemCard"; import TItemCard from "../../../../components/TItemCard/TItemCard";
import css from "../BestSellerItem/BestSellerItem.module.less"; import css from "../BestSellerItem/BestSellerItem.module.less";
export default function ({ bestSellerData, itemData, ...rest }) { export default function ({ bestSellerData, itemData, ...rest }) {

View File

@@ -1,5 +1,5 @@
@import "../../../style/CommonStyle.module.less"; @import "../../../../style/CommonStyle.module.less";
@import "../../../style/utils.module.less"; @import "../../../../style/utils.module.less";
/* vertical type (Thumbnail) */ /* vertical type (Thumbnail) */
.vertical { .vertical {

View File

@@ -8,8 +8,8 @@ import ri from "@enact/ui/resolution";
import TGrid from "../../../components/TGrid/TGrid"; import TGrid from "../../../components/TGrid/TGrid";
import { $L } from "../../../utils/helperMethods"; import { $L } from "../../../utils/helperMethods";
import HomeOnSaleItem from "../HomeOnSaleItem/HomeOnSaleItem";
import css from "./HomeOnSale.module.less"; import css from "./HomeOnSale.module.less";
import HomeOnSaleItem from "./HomeOnSaleItem/HomeOnSaleItem";
const SALE_ITEM_CONF = { const SALE_ITEM_CONF = {
ITEM_WIDTH: 630 * 2, ITEM_WIDTH: 630 * 2,

View File

@@ -1,4 +1,4 @@
@import "../../../style/CommonStyle.module.less"; @import "../../../../style/CommonStyle.module.less";
.onSaleItemList { .onSaleItemList {
width: 630px; width: 630px;
height: 300px; height: 300px;

View File

@@ -1,4 +1,4 @@
import React, { useCallback, useEffect } from "react"; import React, { useCallback, useEffect, useState } from "react";
import classNames from "classnames"; import classNames from "classnames";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
@@ -7,11 +7,10 @@ import { VirtualGridList } from "@enact/sandstone/VirtualList";
import { SpotlightContainerDecorator } from "@enact/spotlight/SpotlightContainerDecorator"; import { SpotlightContainerDecorator } from "@enact/spotlight/SpotlightContainerDecorator";
import ri from "@enact/ui/resolution"; import ri from "@enact/ui/resolution";
import { getTop20Show } from "../../../actions/mainActions";
import TGrid from "../../../components/TGrid/TGrid"; import TGrid from "../../../components/TGrid/TGrid";
import { $L } from "../../../utils/helperMethods"; import { $L } from "../../../utils/helperMethods";
import css from "../PopularShow/PopularShow.module.less"; import css from "../PopularShow/PopularShow.module.less";
import PopularShowItem from "../PopularShowItem/PopularShowItem"; import PopularShowItem from "./PopularShowItem/PopularShowItem";
const Container = SpotlightContainerDecorator( const Container = SpotlightContainerDecorator(
{ enterTo: "last-focused" }, { enterTo: "last-focused" },
@@ -21,12 +20,16 @@ const Container = SpotlightContainerDecorator(
const PopularShow = ({ ...rest }) => { const PopularShow = ({ ...rest }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const topInfos = useSelector((state) => state.main.top20ShowData.topInfos); const topInfos = useSelector((state) => state.main.top20ShowData.topInfos);
const renderItem = useCallback(({ index, ...rest }) => {
const itemData = topInfos[index]; const renderItem = useCallback(
return ( ({ index, ...rest }) => {
<PopularShowItem topInfosData={topInfos} itemNum={itemData} {...rest} /> const itemData = topInfos[index];
); return (
}, []); <PopularShowItem topInfosData={topInfos} itemNum={itemData} {...rest} />
);
},
[topInfos]
);
return ( return (
<Container className={css.popularShow}> <Container className={css.popularShow}>

View File

@@ -1,4 +1,4 @@
@import "../../../style/CommonStyle.module.less"; @import "../../../../style/CommonStyle.module.less";
.listItem { .listItem {
width: 546px; width: 546px;
height: 438px; height: 438px;

View File

@@ -1,28 +1,19 @@
import React, { import React, { useCallback, useEffect, useState } from "react";
useCallback,
useEffect,
useState,
} from 'react';
import { import { useDispatch, useSelector } from "react-redux";
useDispatch,
useSelector,
} from 'react-redux';
import VirtualGridList from '@enact/sandstone/VirtualList'; import VirtualGridList from "@enact/sandstone/VirtualList";
import { import { SpotlightContainerDecorator } from "@enact/spotlight/SpotlightContainerDecorator";
SpotlightContainerDecorator, import Spottable from "@enact/spotlight/Spottable";
} from '@enact/spotlight/SpotlightContainerDecorator'; import ri from "@enact/ui/resolution";
import Spottable from '@enact/spotlight/Spottable';
import ri from '@enact/ui/resolution';
import { getSubCategory } from '../../../actions/mainActions'; import { getSubCategory } from "../../../actions/mainActions";
import { getOnSaleInfo } from '../../../actions/onSaleActions'; import { getOnSaleInfo } from "../../../actions/onSaleActions";
import TGrid from '../../../components/TGrid/TGrid'; import TGrid from "../../../components/TGrid/TGrid";
import TItemCard from '../../../components/TItemCard/TItemCard'; import TItemCard from "../../../components/TItemCard/TItemCard";
import css from '../../HomePanel/SubCategory/SubCategory.module.less'; import css from "../../HomePanel/SubCategory/SubCategory.module.less";
import CategoryNav from '../../OnSalePanel/CategoryNav/CategoryNav'; import CategoryNav from "../../OnSalePanel/CategoryNav/CategoryNav";
import SubCategoryItem from '../SubCategoryItem/SubCategoryItem'; import SubCategoryItem from "./SubCategoryItem/SubCategoryItem";
const SpottableComponent = Spottable("div"); const SpottableComponent = Spottable("div");
const Container = SpotlightContainerDecorator( const Container = SpotlightContainerDecorator(

View File

@@ -1,5 +1,5 @@
@import "../../../style/CommonStyle.module.less"; @import "../../../../style/CommonStyle.module.less";
@import "../../../style/utils.module.less"; @import "../../../../style/utils.module.less";
.vertical { .vertical {
/* normal */ /* normal */
position: relative; position: relative;