[HomePanel] 로직 변경
This commit is contained in:
@@ -6,7 +6,6 @@ import React, {
|
|||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import {
|
import {
|
||||||
shallowEqual,
|
|
||||||
useDispatch,
|
useDispatch,
|
||||||
useSelector,
|
useSelector,
|
||||||
} from 'react-redux';
|
} from 'react-redux';
|
||||||
@@ -19,6 +18,7 @@ import {
|
|||||||
} from '@enact/spotlight/SpotlightContainerDecorator';
|
} from '@enact/spotlight/SpotlightContainerDecorator';
|
||||||
import Spottable from '@enact/spotlight/Spottable';
|
import Spottable from '@enact/spotlight/Spottable';
|
||||||
|
|
||||||
|
import { getHomeMainContents } from '../../../actions/homeActions';
|
||||||
import CustomImage from '../../../components/CustomImage/CustomImage';
|
import CustomImage from '../../../components/CustomImage/CustomImage';
|
||||||
import Random from './RandomUnit';
|
import Random from './RandomUnit';
|
||||||
import Rolling from './RollingUnit';
|
import Rolling from './RollingUnit';
|
||||||
@@ -33,158 +33,188 @@ const Container = SpotlightContainerDecorator(
|
|||||||
"div"
|
"div"
|
||||||
);
|
);
|
||||||
|
|
||||||
export default function HomeBannerTemplate1({
|
export default function HomeBannerTemplate1() {
|
||||||
isOnTop,
|
|
||||||
spotlightId,
|
|
||||||
onScrollTop,
|
|
||||||
onScrollShelf,
|
|
||||||
homeMainContentsBannerInfos,
|
|
||||||
homeTopDisplayInfos,
|
|
||||||
...rest
|
|
||||||
}) {
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [bannerImageLoaded, setBannerImageLoaded] = useState(false);
|
const [bannerImageLoaded, setBannerImageLoaded] = useState(false);
|
||||||
|
const [bannerInfos, setBannerInfos] = useState([]);
|
||||||
|
const [vctpImage1, setVctpImage1] = useState(null);
|
||||||
|
const [vctpImage2, setVctpImage2] = useState(null);
|
||||||
|
const [wdthImage1, setWdthImage1] = useState(null);
|
||||||
|
const [wdthImage2, setWdthImage2] = useState(null);
|
||||||
|
|
||||||
const [baner1Index, setBaner1Index] = useState("");
|
const homeMainContentsBannerInfos = useSelector(
|
||||||
const [baner2Index, setBaner2Index] = useState("");
|
(state) => state.home.mainContentsData.homeMainContentsBannerInfos
|
||||||
const [baner3Index, setBaner3Index] = useState("");
|
);
|
||||||
const [baner4Index, setBaner4Index] = useState("");
|
|
||||||
|
|
||||||
const [baner1Data, setBaner1Data] = useState([]);
|
const homeTopDisplayInfos = useSelector(
|
||||||
const [baner2Data, setBaner2Data] = useState([]);
|
(state) => state.home.mainContentsData.homeTopDisplayInfos
|
||||||
const [baner3Data, setBaner3Data] = useState([]);
|
);
|
||||||
const [baner4Data, setBaner4Data] = useState([]);
|
|
||||||
|
|
||||||
const bannerInfos = homeMainContentsBannerInfos[0].bannerInfos;
|
|
||||||
|
|
||||||
// 배너가 없는 경우, 대체용 배너 [수직]
|
|
||||||
const replaceBannerVtctp = useCallback(() => {
|
|
||||||
let imgPath = "";
|
|
||||||
|
|
||||||
if (
|
|
||||||
homeTopDisplayInfos[0].vtctpImgPath1 == "" ||
|
|
||||||
homeTopDisplayInfos[0].vtctpImgPath1 == null
|
|
||||||
) {
|
|
||||||
imgPath = homeTopDisplayInfos[0].vtctpImgPath2;
|
|
||||||
} else {
|
|
||||||
imgPath = homeTopDisplayInfos[0].vtctpImgPath1;
|
|
||||||
}
|
|
||||||
return imgPath;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// 배너가 없는 경우, 대체용 배너 [수평]
|
|
||||||
const replaceBannerWdth = useCallback(() => {
|
|
||||||
let imgPath = "";
|
|
||||||
|
|
||||||
if (
|
|
||||||
homeTopDisplayInfos[0].wdthtpImgPath1 == "" ||
|
|
||||||
homeTopDisplayInfos[0].wdthtpImgPath1 == null
|
|
||||||
) {
|
|
||||||
imgPath = homeTopDisplayInfos[0].wdthtpImgPath2;
|
|
||||||
} else {
|
|
||||||
imgPath = homeTopDisplayInfos[0].wdthtpImgPath1;
|
|
||||||
}
|
|
||||||
return imgPath;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const onClickBanner = useCallback(() => {}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
bannerInfos.forEach((el, index) => {
|
if (homeTopDisplayInfos) {
|
||||||
if (el.banrLctnNo == "1") {
|
const vctpImage1 = homeTopDisplayInfos[0].vtctpImgPath1;
|
||||||
setBaner1Data(el);
|
const vctpImage2 = homeTopDisplayInfos[0].vtctpImgPath2;
|
||||||
setBaner1Index(index);
|
const wdthImage1 = homeTopDisplayInfos[0].wdthtpImgPath1;
|
||||||
} else if (el.banrLctnNo == "2") {
|
const wdthImage2 = homeTopDisplayInfos[0].wdthtpImgPath2;
|
||||||
setBaner2Data(el);
|
setVctpImage1(vctpImage1);
|
||||||
setBaner2Index(index);
|
setVctpImage2(vctpImage2);
|
||||||
} else if (el.banrLctnNo == "3") {
|
setWdthImage1(wdthImage1);
|
||||||
setBaner3Data(el);
|
setWdthImage2(wdthImage2);
|
||||||
setBaner3Index(index);
|
}
|
||||||
} else if (el.banrLctnNo == "4") {
|
}, [homeTopDisplayInfos]);
|
||||||
setBaner4Data(el);
|
|
||||||
setBaner4Index(index);
|
useEffect(() => {
|
||||||
}
|
if (homeMainContentsBannerInfos) {
|
||||||
});
|
const banerInfo = homeMainContentsBannerInfos[0].bannerInfos;
|
||||||
console.log(homeMainContentsBannerInfos, "메인 컨텐츠");
|
setBannerInfos(banerInfo);
|
||||||
console.log(homeTopDisplayInfos, "탑디스");
|
}
|
||||||
}, [homeMainContentsBannerInfos]);
|
}, [homeMainContentsBannerInfos]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// console.log(homeMainContentsBannerInfos, "메인 컨텐츠");
|
||||||
|
// console.log(homeTopDisplayInfos, "탑디스");
|
||||||
|
dispatch(getHomeMainContents);
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
|
const onClickBanner = useCallback(() => {}, []);
|
||||||
return (
|
return (
|
||||||
<Container className={(css.container, css.homeTemplateBox)}>
|
<Container className={(css.container, css.homeTemplateBox)}>
|
||||||
<SpottableComponent>
|
<SpottableComponent>
|
||||||
<div className={classNames(css.leftBannerBox, css.dualBox)}>
|
<div className={classNames(css.leftBannerBox, css.dualBox)}>
|
||||||
{/* 배너1 */}
|
{/* 배너1 */}
|
||||||
{baner1Data.shptmDspyTpNm == "Rolling" ? (
|
{bannerInfos &&
|
||||||
<Rolling bannerData={baner2Data} className={css.topBox} />
|
bannerInfos.map((item, index) => {
|
||||||
) : baner1Data.shptmDspyTpNm == "Random" ? (
|
return item.banrLctnNo === "1" &&
|
||||||
<Random bannerData={baner3Data} className={css.topBox} />
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
) : (
|
<Rolling
|
||||||
<CustomImage
|
bannerData={item}
|
||||||
delay={0}
|
className={css.topBox}
|
||||||
onClickBanner={onClickBanner}
|
key={index}
|
||||||
onImageLoaded={""}
|
imageType={true}
|
||||||
src={replaceBannerWdth}
|
/>
|
||||||
hide={""}
|
) : item.banrLctnNo === "1" && item.shptmDspyTpNm == "Random" ? (
|
||||||
className={css.topBox}
|
<Random
|
||||||
/>
|
bannerData={item}
|
||||||
)}
|
className={css.topBox}
|
||||||
|
key={index}
|
||||||
|
imageType={true}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CustomImage
|
||||||
|
key={index}
|
||||||
|
className={css.topBox}
|
||||||
|
onClickBanner={onClickBanner}
|
||||||
|
delay={0}
|
||||||
|
src={
|
||||||
|
wdthImage1 === "" || wdthImage1 === null
|
||||||
|
? wdthImage2
|
||||||
|
: wdthImage1
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
{/* 배너2 */}
|
{/* 배너2 */}
|
||||||
{baner2Data.shptmDspyTpNm == "Rolling" ? (
|
{bannerInfos &&
|
||||||
<Rolling bannerData={baner2Data} className={css.underBox} />
|
bannerInfos.map((item, index) => {
|
||||||
) : baner2Data.shptmDspyTpNm == "Random" ? (
|
return item.banrLctnNo === "2" &&
|
||||||
<Random bannerData={baner2Data} className={css.underBox} />
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
) : (
|
<Rolling
|
||||||
<CustomImage
|
bannerData={item}
|
||||||
delay={0}
|
className={css.underBox}
|
||||||
onClickBanner={onClickBanner}
|
key={index}
|
||||||
onImageLoaded={""}
|
imageType={true}
|
||||||
src={replaceBannerWdth}
|
/>
|
||||||
hide={""}
|
) : item.banrLctnNo === "2" && item.shptmDspyTpNm == "Random" ? (
|
||||||
className={css.topBox}
|
<Random
|
||||||
/>
|
bannerData={item}
|
||||||
)}
|
className={css.underBox}
|
||||||
|
key={index}
|
||||||
|
imageType={true}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CustomImage
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
onClickBanner={onClickBanner}
|
||||||
|
delay={0}
|
||||||
|
src={
|
||||||
|
wdthImage1 === "" || wdthImage1 === null
|
||||||
|
? wdthImage2
|
||||||
|
: wdthImage1
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={css.bannerFlexRow}>
|
||||||
|
{/* 배너3 */}
|
||||||
|
{bannerInfos &&
|
||||||
|
bannerInfos.map((item, index) => {
|
||||||
|
return item.banrLctnNo === "3" &&
|
||||||
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
|
<Rolling
|
||||||
|
bannerData={item}
|
||||||
|
className={css.banner03}
|
||||||
|
key={index}
|
||||||
|
imageType={false}
|
||||||
|
/>
|
||||||
|
) : item.banrLctnNo === "3" && item.shptmDspyTpNm == "Random" ? (
|
||||||
|
<Random
|
||||||
|
bannerData={item}
|
||||||
|
className={css.banner03}
|
||||||
|
key={index}
|
||||||
|
imageType={false}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CustomImage
|
||||||
|
key={index}
|
||||||
|
className={css.banner03}
|
||||||
|
onClickBanner={onClickBanner}
|
||||||
|
delay={0}
|
||||||
|
src={
|
||||||
|
wdthImage1 === "" || wdthImage1 === null
|
||||||
|
? wdthImage2
|
||||||
|
: wdthImage1
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
|
||||||
|
{/* 배너4 */}
|
||||||
|
{bannerInfos &&
|
||||||
|
bannerInfos.map((item, index) => {
|
||||||
|
return item.banrLctnNo === "4" &&
|
||||||
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
|
<Rolling
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={false}
|
||||||
|
/>
|
||||||
|
) : item.banrLctnNo === "4" && item.shptmDspyTpNm == "Random" ? (
|
||||||
|
<Random
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={false}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CustomImage
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
onClickBanner={onClickBanner}
|
||||||
|
delay={0}
|
||||||
|
src={
|
||||||
|
wdthImage1 === "" || wdthImage1 === null
|
||||||
|
? wdthImage2
|
||||||
|
: wdthImage1
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</SpottableComponent>
|
</SpottableComponent>
|
||||||
|
|
||||||
<div className={css.bannerFlexRow}>
|
|
||||||
{/* 배너3 */}
|
|
||||||
{baner3Data.shptmDspyTpNm == "Rolling" ? (
|
|
||||||
<Rolling bannerData={baner3Data} />
|
|
||||||
) : baner3Data.shptmDspyTpNm == "Random" ? (
|
|
||||||
<Random bannerData={baner3Data} />
|
|
||||||
) : (
|
|
||||||
<SpottableComponent>
|
|
||||||
<CustomImage
|
|
||||||
className={css.banner03}
|
|
||||||
delay={0}
|
|
||||||
onClickBanner={onClickBanner}
|
|
||||||
onImageLoaded={""}
|
|
||||||
src={replaceBannerVtctp}
|
|
||||||
hide={""}
|
|
||||||
/>
|
|
||||||
</SpottableComponent>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* 배너4 */}
|
|
||||||
{baner4Data.shptmDspyTpNm == "Rolling" ? (
|
|
||||||
<SpottableComponent>
|
|
||||||
<Rolling bannerData={baner4Data} />
|
|
||||||
</SpottableComponent>
|
|
||||||
) : baner4Data.shptmDspyTpNm == "Random" ? (
|
|
||||||
<Random bannerData={baner4Data} />
|
|
||||||
) : (
|
|
||||||
<SpottableComponent>
|
|
||||||
<CustomImage
|
|
||||||
className={css.banner03}
|
|
||||||
delay={0}
|
|
||||||
onClickBanner={onClickBanner}
|
|
||||||
onImageLoaded={""}
|
|
||||||
src={replaceBannerVtctp}
|
|
||||||
hide={""}
|
|
||||||
/>
|
|
||||||
</SpottableComponent>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,28 @@
|
|||||||
import React, {
|
import React, {
|
||||||
memo,
|
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
|
||||||
useRef,
|
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from 'react';
|
||||||
|
|
||||||
import classNames from "classnames";
|
import classNames from 'classnames';
|
||||||
|
import {
|
||||||
|
useDispatch,
|
||||||
|
useSelector,
|
||||||
|
} from 'react-redux';
|
||||||
|
|
||||||
import Spotlight from "@enact/spotlight";
|
import { Job } from '@enact/core/util';
|
||||||
import { SpotlightContainerDecorator } from "@enact/spotlight/SpotlightContainerDecorator";
|
import Marquee from '@enact/sandstone/Marquee';
|
||||||
import Spottable from "@enact/spotlight/Spottable";
|
import Spotlight from '@enact/spotlight';
|
||||||
|
import {
|
||||||
|
SpotlightContainerDecorator,
|
||||||
|
} from '@enact/spotlight/SpotlightContainerDecorator';
|
||||||
|
import Spottable from '@enact/spotlight/Spottable';
|
||||||
|
|
||||||
import testimg from "../../../../assets/h430054.webp";
|
import { getHomeMainContents } from '../../../actions/homeActions';
|
||||||
import banner2 from "../../../../assets/Image/img-home-banner-h-02.png";
|
import CustomImage from '../../../components/CustomImage/CustomImage';
|
||||||
import banner4 from "../../../../assets/Image/img-home-banner-v-02.png";
|
import Random from './RandomUnit';
|
||||||
import banner3 from "../../../../assets/images/mainTemplate/img-home-banner-td-ver.svg";
|
import Rolling from './RollingUnit';
|
||||||
import HomeTodayDeal from "../HomeTodayDeal/HomeTodayDeal";
|
import css from './Template.module.less';
|
||||||
import css from "./Template.module.less";
|
|
||||||
|
|
||||||
const SpottableComponent = Spottable("div");
|
const SpottableComponent = Spottable("div");
|
||||||
|
|
||||||
@@ -28,30 +32,188 @@ const Container = SpotlightContainerDecorator(
|
|||||||
},
|
},
|
||||||
"div"
|
"div"
|
||||||
);
|
);
|
||||||
export default function HomeBannerTemplate2({
|
|
||||||
isOnTop,
|
export default function HomeBannerTemplate2() {
|
||||||
spotlightId,
|
const dispatch = useDispatch();
|
||||||
onScrollTop,
|
const [bannerImageLoaded, setBannerImageLoaded] = useState(false);
|
||||||
onScrollShelf,
|
const [bannerInfos, setBannerInfos] = useState([]);
|
||||||
homeMainContentsBannerInfos,
|
const [vctpImage1, setVctpImage1] = useState(null);
|
||||||
homeTopDisplayInfos,
|
const [vctpImage2, setVctpImage2] = useState(null);
|
||||||
...rest
|
const [wdthImage1, setWdthImage1] = useState(null);
|
||||||
}) {
|
const [wdthImage2, setWdthImage2] = useState(null);
|
||||||
|
|
||||||
|
const homeMainContentsBannerInfos = useSelector(
|
||||||
|
(state) => state.home.mainContentsData.homeMainContentsBannerInfos
|
||||||
|
);
|
||||||
|
|
||||||
|
const homeTopDisplayInfos = useSelector(
|
||||||
|
(state) => state.home.mainContentsData.homeTopDisplayInfos
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (homeTopDisplayInfos) {
|
||||||
|
const vctpImage1 = homeTopDisplayInfos[0].vtctpImgPath1;
|
||||||
|
const vctpImage2 = homeTopDisplayInfos[0].vtctpImgPath2;
|
||||||
|
const wdthImage1 = homeTopDisplayInfos[0].wdthtpImgPath1;
|
||||||
|
const wdthImage2 = homeTopDisplayInfos[0].wdthtpImgPath2;
|
||||||
|
setVctpImage1(vctpImage1);
|
||||||
|
setVctpImage2(vctpImage2);
|
||||||
|
setWdthImage1(wdthImage1);
|
||||||
|
setWdthImage2(wdthImage2);
|
||||||
|
}
|
||||||
|
}, [homeTopDisplayInfos]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (homeMainContentsBannerInfos) {
|
||||||
|
const banerInfo = homeMainContentsBannerInfos[0].bannerInfos;
|
||||||
|
setBannerInfos(banerInfo);
|
||||||
|
}
|
||||||
|
}, [homeMainContentsBannerInfos]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log(homeMainContentsBannerInfos, "메인 컨텐츠");
|
||||||
|
console.log(homeTopDisplayInfos, "탑디스");
|
||||||
|
dispatch(getHomeMainContents);
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
|
const onClickBanner = useCallback(() => {}, []);
|
||||||
return (
|
return (
|
||||||
<Container className={css.homeTemplateBox}>
|
<Container className={css.homeTemplateBox}>
|
||||||
<SpottableComponent className={css.banner03}>
|
<SpottableComponent className={css.banner03}>
|
||||||
<img src={banner4} />
|
{bannerInfos &&
|
||||||
|
bannerInfos.map((item, index) => {
|
||||||
|
return item.banrLctnNo === "1" &&
|
||||||
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
|
<Rolling
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={false}
|
||||||
|
/>
|
||||||
|
) : item.banrLctnNo === "1" && item.shptmDspyTpNm == "Random" ? (
|
||||||
|
<Random
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={false}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CustomImage
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
onClickBanner={onClickBanner}
|
||||||
|
delay={0}
|
||||||
|
src={
|
||||||
|
vctpImage1 === "" || vctpImage1 === null
|
||||||
|
? vctpImage2
|
||||||
|
: vctpImage1
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</SpottableComponent>
|
</SpottableComponent>
|
||||||
|
|
||||||
<SpottableComponent className={classNames(css.leftBox, css.dualBox)}>
|
<SpottableComponent className={classNames(css.leftBox, css.dualBox)}>
|
||||||
<div className={classNames(css.topBox, css.videoBox)}>
|
<div className={classNames(css.topBox, css.videoBox)}>
|
||||||
<img src={banner2} />
|
{bannerInfos &&
|
||||||
|
bannerInfos.map((item, index) => {
|
||||||
|
return item.banrLctnNo === "2" &&
|
||||||
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
|
<Rolling
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={true}
|
||||||
|
/>
|
||||||
|
) : item.banrLctnNo === "2" && item.shptmDspyTpNm == "Random" ? (
|
||||||
|
<Random
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={true}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CustomImage
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
onClickBanner={onClickBanner}
|
||||||
|
delay={0}
|
||||||
|
src={
|
||||||
|
vctpImage1 === "" || vctpImage1 === null
|
||||||
|
? vctpImage2
|
||||||
|
: vctpImage1
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div className={classNames(css.underBox, css.videoBox)}>
|
<div className={classNames(css.underBox, css.videoBox)}>
|
||||||
<img src={banner2} />
|
{bannerInfos &&
|
||||||
|
bannerInfos.map((item, index) => {
|
||||||
|
return item.banrLctnNo === "3" &&
|
||||||
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
|
<Rolling
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={true}
|
||||||
|
/>
|
||||||
|
) : item.banrLctnNo === "3" && item.shptmDspyTpNm == "Random" ? (
|
||||||
|
<Random
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={true}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CustomImage
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
onClickBanner={onClickBanner}
|
||||||
|
delay={0}
|
||||||
|
src={
|
||||||
|
wdthImage1 === "" || wdthImage1 === null
|
||||||
|
? wdthImage2
|
||||||
|
: wdthImage1
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</SpottableComponent>
|
</SpottableComponent>
|
||||||
|
|
||||||
<SpottableComponent className={css.banner03}>
|
<SpottableComponent className={css.banner03}>
|
||||||
<img src={banner4} />
|
{bannerInfos &&
|
||||||
|
bannerInfos.map((item, index) => {
|
||||||
|
return item.banrLctnNo === "4" &&
|
||||||
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
|
<Rolling
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={false}
|
||||||
|
/>
|
||||||
|
) : item.banrLctnNo === "4" && item.shptmDspyTpNm == "Random" ? (
|
||||||
|
<Random
|
||||||
|
bannerData={item}
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
imageType={false}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CustomImage
|
||||||
|
key={index}
|
||||||
|
className={""}
|
||||||
|
onClickBanner={onClickBanner}
|
||||||
|
delay={0}
|
||||||
|
src={
|
||||||
|
vctpImage1 === "" || vctpImage1 === null
|
||||||
|
? vctpImage2
|
||||||
|
: vctpImage1
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</SpottableComponent>
|
</SpottableComponent>
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -18,13 +18,8 @@ import {
|
|||||||
} from '@enact/spotlight/SpotlightContainerDecorator';
|
} from '@enact/spotlight/SpotlightContainerDecorator';
|
||||||
import Spottable from '@enact/spotlight/Spottable';
|
import Spottable from '@enact/spotlight/Spottable';
|
||||||
|
|
||||||
import testimg from '../../../../assets/h430054.webp';
|
import { getHomeMainContents } from '../../../actions/homeActions';
|
||||||
import banner2 from '../../../../assets/Image/img-home-banner-h-02.png';
|
|
||||||
import banner4 from '../../../../assets/Image/img-home-banner-v-02.png';
|
|
||||||
import banner3
|
|
||||||
from '../../../../assets/images/mainTemplate/img-home-banner-td-ver.svg';
|
|
||||||
import CustomImage from '../../../components/CustomImage/CustomImage';
|
import CustomImage from '../../../components/CustomImage/CustomImage';
|
||||||
import HomeTodayDeal from '../HomeTodayDeal/HomeTodayDeal';
|
|
||||||
import Random from './RandomUnit';
|
import Random from './RandomUnit';
|
||||||
import Rolling from './RollingUnit';
|
import Rolling from './RollingUnit';
|
||||||
import css from './Template.module.less';
|
import css from './Template.module.less';
|
||||||
@@ -38,155 +33,154 @@ const Container = SpotlightContainerDecorator(
|
|||||||
"div"
|
"div"
|
||||||
);
|
);
|
||||||
|
|
||||||
export default function HomeBannerTemplate3({
|
export default function HomeBannerTemplate3() {
|
||||||
isOnTop,
|
|
||||||
spotlightId,
|
|
||||||
onScrollTop,
|
|
||||||
onScrollShelf,
|
|
||||||
homeMainContentsBannerInfos,
|
|
||||||
homeTopDisplayInfos,
|
|
||||||
...rest
|
|
||||||
}) {
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [bannerImageLoaded, setBannerImageLoaded] = useState(false);
|
const [bannerImageLoaded, setBannerImageLoaded] = useState(false);
|
||||||
|
const [bannerInfos, setBannerInfos] = useState([]);
|
||||||
|
const [vctpImage1, setVctpImage1] = useState(null);
|
||||||
|
const [vctpImage2, setVctpImage2] = useState(null);
|
||||||
|
const [wdthImage1, setWdthImage1] = useState(null);
|
||||||
|
const [wdthImage2, setWdthImage2] = useState(null);
|
||||||
|
|
||||||
const [baner1Index, setBaner1Index] = useState("");
|
const homeMainContentsBannerInfos = useSelector(
|
||||||
const [baner2Index, setBaner2Index] = useState("");
|
(state) => state.home.mainContentsData.homeMainContentsBannerInfos
|
||||||
const [baner3Index, setBaner3Index] = useState("");
|
);
|
||||||
const [baner4Index, setBaner4Index] = useState("");
|
|
||||||
|
|
||||||
const [baner1Data, setBaner1Data] = useState([]);
|
const homeTopDisplayInfos = useSelector(
|
||||||
const [baner2Data, setBaner2Data] = useState([]);
|
(state) => state.home.mainContentsData.homeTopDisplayInfos
|
||||||
const [baner3Data, setBaner3Data] = useState([]);
|
);
|
||||||
const [baner4Data, setBaner4Data] = useState([]);
|
|
||||||
|
|
||||||
const bannerInfos = homeMainContentsBannerInfos[0].bannerInfos;
|
useEffect(() => {
|
||||||
|
if (homeTopDisplayInfos) {
|
||||||
// 배너가 없는 경우, 대체용 배너 [수직]
|
const vctpImage1 = homeTopDisplayInfos[0].vtctpImgPath1;
|
||||||
const replaceBannerVtctp = useCallback(() => {
|
const vctpImage2 = homeTopDisplayInfos[0].vtctpImgPath2;
|
||||||
let imgPath = "";
|
const wdthImage1 = homeTopDisplayInfos[0].wdthtpImgPath1;
|
||||||
|
const wdthImage2 = homeTopDisplayInfos[0].wdthtpImgPath2;
|
||||||
if (
|
setVctpImage1(vctpImage1);
|
||||||
homeTopDisplayInfos[0].vtctpImgPath1 == "" ||
|
setVctpImage2(vctpImage2);
|
||||||
homeTopDisplayInfos[0].vtctpImgPath1 == null
|
setWdthImage1(wdthImage1);
|
||||||
) {
|
setWdthImage2(wdthImage2);
|
||||||
imgPath = homeTopDisplayInfos[0].vtctpImgPath2;
|
|
||||||
} else {
|
|
||||||
imgPath = homeTopDisplayInfos[0].vtctpImgPath1;
|
|
||||||
}
|
}
|
||||||
return imgPath;
|
}, [homeTopDisplayInfos]);
|
||||||
}, []);
|
|
||||||
|
|
||||||
// 배너가 없는 경우, 대체용 배너 [수직]
|
useEffect(() => {
|
||||||
const replaceBannerWdth = useCallback(() => {
|
if (homeMainContentsBannerInfos) {
|
||||||
let imgPath = "";
|
const banerInfo = homeMainContentsBannerInfos[0].bannerInfos;
|
||||||
|
setBannerInfos(banerInfo);
|
||||||
if (
|
|
||||||
homeTopDisplayInfos[0].wdthtpImgPath1 == "" ||
|
|
||||||
homeTopDisplayInfos[0].wdthtpImgPath1 == null
|
|
||||||
) {
|
|
||||||
imgPath = homeTopDisplayInfos[0].wdthtpImgPath2;
|
|
||||||
} else {
|
|
||||||
imgPath = homeTopDisplayInfos[0].wdthtpImgPath1;
|
|
||||||
}
|
}
|
||||||
return imgPath;
|
}, [homeMainContentsBannerInfos]);
|
||||||
}, []);
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log(homeMainContentsBannerInfos, "메인 컨텐츠");
|
||||||
|
console.log(homeTopDisplayInfos, "탑디스");
|
||||||
|
dispatch(getHomeMainContents);
|
||||||
|
}, [dispatch]);
|
||||||
|
|
||||||
const onClickBanner = useCallback(() => {}, []);
|
const onClickBanner = useCallback(() => {}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
bannerInfos.forEach((el, index) => {
|
|
||||||
if (el.banrLctnNo == "1") {
|
|
||||||
setBaner1Data(el);
|
|
||||||
setBaner1Index(index);
|
|
||||||
} else if (el.banrLctnNo == "2") {
|
|
||||||
setBaner2Data(el);
|
|
||||||
setBaner2Index(index);
|
|
||||||
} else if (el.banrLctnNo == "3") {
|
|
||||||
setBaner3Data(el);
|
|
||||||
setBaner3Index(index);
|
|
||||||
} else if (el.banrLctnNo == "4") {
|
|
||||||
setBaner4Data(el);
|
|
||||||
setBaner4Index(index);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(homeMainContentsBannerInfos, "메인 컨텐츠");
|
|
||||||
console.log(homeTopDisplayInfos, "탑디스");
|
|
||||||
}, [homeMainContentsBannerInfos]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className={css.homeTemplateBox}>
|
<Container className={css.homeTemplateBox}>
|
||||||
<div class={css.mainBox}>
|
<div className={css.mainBox}>
|
||||||
|
{/* 배너1 */}
|
||||||
<SpottableComponent className={css.imgBox}>
|
<SpottableComponent className={css.imgBox}>
|
||||||
{baner1Data.shptmDspyTpNm == "Rolling" ? (
|
{bannerInfos &&
|
||||||
<Rolling bannerData={baner1Data} />
|
bannerInfos.map((item, index) => {
|
||||||
) : baner1Data.shptmDspyTpNm == "Random" ? (
|
return item.banrLctnNo === "1" &&
|
||||||
<Random bannerData={baner1Data} />
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
) : (
|
<Rolling bannerData={item} key={index} />
|
||||||
<CustomImage
|
) : item.banrLctnNo === "1" && item.shptmDspyTpNm == "Random" ? (
|
||||||
className={""}
|
<Random bannerData={item} key={index} />
|
||||||
delay={0}
|
) : (
|
||||||
onClickBanner={onClickBanner}
|
<CustomImage
|
||||||
onImageLoaded={""}
|
key={index}
|
||||||
src={replaceBannerVtctp}
|
className={""}
|
||||||
hide={""}
|
onClickBanner={onClickBanner}
|
||||||
/>
|
src={
|
||||||
)}
|
vctpImage1 === "" || vctpImage1 === null
|
||||||
|
? vctpImage2
|
||||||
|
: vctpImage1
|
||||||
|
}
|
||||||
|
delay={0}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</SpottableComponent>
|
</SpottableComponent>
|
||||||
|
{/* 배너2 */}
|
||||||
<SpottableComponent className={css.imgBox}>
|
<SpottableComponent className={css.imgBox}>
|
||||||
{baner2Data.shptmDspyTpNm == "Rolling" ? (
|
{bannerInfos &&
|
||||||
<Rolling bannerData={baner2Data} />
|
bannerInfos.map((item, index) => {
|
||||||
) : baner2Data.shptmDspyTpNm == "Random" ? (
|
return item.banrLctnNo === "2" &&
|
||||||
<Random bannerData={baner2Data} />
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
) : (
|
<Rolling bannerData={item} key={index} />
|
||||||
<CustomImage
|
) : item.banrLctnNo === "2" && item.shptmDspyTpNm == "Random" ? (
|
||||||
className={""}
|
<Random bannerData={item} key={index} />
|
||||||
delay={0}
|
) : (
|
||||||
onClickBanner={onClickBanner}
|
<CustomImage
|
||||||
onImageLoaded={""}
|
key={index}
|
||||||
src={replaceBannerVtctp}
|
className={""}
|
||||||
hide={""}
|
onClickBanner={onClickBanner}
|
||||||
/>
|
src={
|
||||||
)}
|
vctpImage1 === "" || vctpImage1 === null
|
||||||
|
? vctpImage2
|
||||||
|
: vctpImage1
|
||||||
|
}
|
||||||
|
delay={0}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</SpottableComponent>
|
</SpottableComponent>
|
||||||
|
{/* 배너3 */}
|
||||||
<div className={css.dualBox}>
|
<div className={css.dualBox}>
|
||||||
<SpottableComponent className={classNames(css.videoBox, css.topBox)}>
|
<SpottableComponent className={classNames(css.videoBox, css.topBox)}>
|
||||||
{baner3Data.shptmDspyTpNm == "Rolling" ? (
|
{bannerInfos &&
|
||||||
<Rolling bannerData={baner3Data} />
|
bannerInfos.map((item, index) => {
|
||||||
) : baner3Data.shptmDspyTpNm == "Random" ? (
|
return item.banrLctnNo === "3" &&
|
||||||
<Random bannerData={baner3Data} />
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
) : (
|
<Rolling bannerData={item} key={index} />
|
||||||
<CustomImage
|
) : item.banrLctnNo === "3" &&
|
||||||
className={""}
|
item.shptmDspyTpNm == "Random" ? (
|
||||||
delay={0}
|
<Random bannerData={item} key={index} />
|
||||||
onClickBanner={onClickBanner}
|
) : (
|
||||||
onImageLoaded={""}
|
<CustomImage
|
||||||
src={replaceBannerWdth}
|
key={index}
|
||||||
hide={""}
|
className={""}
|
||||||
/>
|
onClickBanner={onClickBanner}
|
||||||
)}
|
src={
|
||||||
|
wdthImage1 === "" || wdthImage1 === null
|
||||||
|
? wdthImage2
|
||||||
|
: wdthImage1
|
||||||
|
}
|
||||||
|
delay={0}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</SpottableComponent>
|
</SpottableComponent>
|
||||||
|
{/* 배너4 */}
|
||||||
<SpottableComponent
|
<SpottableComponent
|
||||||
className={classNames(css.videoBox, css.underBox)}
|
className={classNames(css.videoBox, css.underBox)}
|
||||||
>
|
>
|
||||||
{baner4Data.shptmDspyTpNm == "Rolling" ? (
|
{bannerInfos &&
|
||||||
<Rolling bannerData={baner4Data} />
|
bannerInfos.map((item, index) => {
|
||||||
) : baner4Data.shptmDspyTpNm == "Random" ? (
|
return item.banrLctnNo === "4" &&
|
||||||
<Random bannerData={baner4Data} />
|
item.shptmDspyTpNm == "Rolling" ? (
|
||||||
) : (
|
<Rolling bannerData={item} key={index} />
|
||||||
<CustomImage
|
) : item.banrLctnNo === "4" &&
|
||||||
className={""}
|
item.shptmDspyTpNm == "Random" ? (
|
||||||
delay={0}
|
<Random bannerData={item} key={index} />
|
||||||
onClickBanner={onClickBanner}
|
) : (
|
||||||
onImageLoaded={""}
|
<CustomImage
|
||||||
src={replaceBannerWdth}
|
key={index}
|
||||||
hide={""}
|
className={""}
|
||||||
/>
|
onClickBanner={onClickBanner}
|
||||||
)}
|
src={
|
||||||
|
wdthImage1 === "" || wdthImage1 === null
|
||||||
|
? wdthImage2
|
||||||
|
: wdthImage1
|
||||||
|
}
|
||||||
|
delay={0}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</SpottableComponent>
|
</SpottableComponent>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,18 +1,11 @@
|
|||||||
import React, {
|
import React, {
|
||||||
memo,
|
|
||||||
useCallback,
|
|
||||||
useEffect,
|
useEffect,
|
||||||
useRef,
|
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
import VideoPlay from '@enact/sandstone/VideoPlayer';
|
|
||||||
|
|
||||||
import CustomImage from '../../../components/CustomImage/CustomImage';
|
|
||||||
import HomeTodayDeal from '../HomeTodayDeal/HomeTodayDeal';
|
import HomeTodayDeal from '../HomeTodayDeal/HomeTodayDeal';
|
||||||
import css from './Template.module.less';
|
|
||||||
|
|
||||||
export default function RandomUnit({ bannerData }) {
|
export default function RandomUnit({ bannerData, imageType }) {
|
||||||
const bannerDetailInfos = bannerData.bannerDetailInfos;
|
const bannerDetailInfos = bannerData.bannerDetailInfos;
|
||||||
const [randomData, setRandomData] = useState([]);
|
const [randomData, setRandomData] = useState([]);
|
||||||
|
|
||||||
@@ -41,7 +34,7 @@ export default function RandomUnit({ bannerData }) {
|
|||||||
productId={randomData.prdtId}
|
productId={randomData.prdtId}
|
||||||
productName={randomData.prdtNm}
|
productName={randomData.prdtNm}
|
||||||
soldoutFlag={randomData.soldoutFlag}
|
soldoutFlag={randomData.soldoutFlag}
|
||||||
isHorizontal={true}
|
isHorizontal={imageType}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -21,7 +21,11 @@ const LIST_ITEM_CONF = {
|
|||||||
SPACING: 30 * 2,
|
SPACING: 30 * 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RollingUnit({ bannerData }) {
|
export default function RollingUnit({ bannerData, imageType }) {
|
||||||
|
useEffect(() => {
|
||||||
|
console.log("롤링");
|
||||||
|
}, []);
|
||||||
|
|
||||||
const renderItem = useCallback(
|
const renderItem = useCallback(
|
||||||
({ index, ...rest }) => {
|
({ index, ...rest }) => {
|
||||||
// const itemData = itemDatas[index];
|
// const itemData = itemDatas[index];
|
||||||
@@ -43,7 +47,7 @@ export default function RollingUnit({ bannerData }) {
|
|||||||
productId={bannerData.bannerDetailInfos[index].prdtId}
|
productId={bannerData.bannerDetailInfos[index].prdtId}
|
||||||
productName={bannerData.bannerDetailInfos[index].prdtNm}
|
productName={bannerData.bannerDetailInfos[index].prdtNm}
|
||||||
soldoutFlag={bannerData.bannerDetailInfos[index].soldoutFlag}
|
soldoutFlag={bannerData.bannerDetailInfos[index].soldoutFlag}
|
||||||
// isHorizontal={true}
|
isHorizontal={imageType} // TRUE, FALSE
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import React, {
|
import React, {
|
||||||
useCallback,
|
|
||||||
useEffect,
|
useEffect,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
@@ -9,6 +8,10 @@ import {
|
|||||||
useSelector,
|
useSelector,
|
||||||
} from 'react-redux';
|
} from 'react-redux';
|
||||||
|
|
||||||
|
import {
|
||||||
|
SpotlightContainerDecorator,
|
||||||
|
} from '@enact/spotlight/SpotlightContainerDecorator';
|
||||||
|
|
||||||
import TPanel from '../../components/TPanel/TPanel';
|
import TPanel from '../../components/TPanel/TPanel';
|
||||||
import BestSeller from '../HomePanel/BestSeller/BestSeller';
|
import BestSeller from '../HomePanel/BestSeller/BestSeller';
|
||||||
import HomeBannerTemplate1 from '../HomePanel/HomeBanner/HomeBannerTemplate1';
|
import HomeBannerTemplate1 from '../HomePanel/HomeBanner/HomeBannerTemplate1';
|
||||||
@@ -19,54 +22,32 @@ import css from '../HomePanel/HomePanel.module.less';
|
|||||||
import PopularShow from '../HomePanel/PopularShow/PopularShow';
|
import PopularShow from '../HomePanel/PopularShow/PopularShow';
|
||||||
import SubCategory from '../HomePanel/SubCategory/SubCategory';
|
import SubCategory from '../HomePanel/SubCategory/SubCategory';
|
||||||
|
|
||||||
|
// const SpottableComponent = Spottable("div");
|
||||||
|
|
||||||
|
const Container = SpotlightContainerDecorator(
|
||||||
|
{
|
||||||
|
enterTo: "default-element",
|
||||||
|
},
|
||||||
|
"div"
|
||||||
|
);
|
||||||
|
|
||||||
export default function HomePanel() {
|
export default function HomePanel() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const homeLayoutInfo = useSelector((state) => state.home.layoutData);
|
const homeLayoutInfo = useSelector((state) => state.home.layoutData);
|
||||||
const homeMainContentsBannerInfos = useSelector(
|
|
||||||
(state) => state.home.mainContentsData.homeMainContentsBannerInfos
|
|
||||||
);
|
|
||||||
const homeTopDisplayInfos = useSelector(
|
const homeTopDisplayInfos = useSelector(
|
||||||
(state) => state.home.mainContentsData.homeTopDisplayInfos
|
(state) => state.home.mainContentsData.homeTopDisplayInfos
|
||||||
);
|
);
|
||||||
|
|
||||||
const [select, setSelect] = useState(null);
|
const [select, setSelect] = useState(null);
|
||||||
const [homeLayoutInfoDetail, setHomeLayoutInfoDetail] = useState([]);
|
const [homeLayoutInfoDetail, setHomeLayoutInfoDetail] = useState([]);
|
||||||
// 추후 스위치 select 로 변경 : 스팟라이트 테스트 중
|
// 추후 스위치 select 로 변경 : 스팟라이트 테스트 중
|
||||||
const selectSwitch = () => {
|
const selectSwitch = (index) => {
|
||||||
switch ("DSP00203") {
|
switch ("DSP00203") {
|
||||||
case "DSP00201":
|
case "DSP00201":
|
||||||
return (
|
return <HomeBannerTemplate1 key={index} />;
|
||||||
<HomeBannerTemplate1
|
|
||||||
isOnTop={""}
|
|
||||||
spotlightId={""}
|
|
||||||
onScrollTop={""}
|
|
||||||
onScrollShelf={""}
|
|
||||||
homeMainContentsBannerInfos={homeMainContentsBannerInfos}
|
|
||||||
homeTopDisplayInfos={homeTopDisplayInfos}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case "DSP00202":
|
case "DSP00202":
|
||||||
return (
|
return <HomeBannerTemplate2 key={index} />;
|
||||||
<HomeBannerTemplate2
|
|
||||||
isOnTop={""}
|
|
||||||
spotlightId={""}
|
|
||||||
onScrollTop={""}
|
|
||||||
onScrollShelf={""}
|
|
||||||
homeMainContentsBannerInfos={homeMainContentsBannerInfos}
|
|
||||||
homeTopDisplayInfos={homeTopDisplayInfos}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case "DSP00203":
|
case "DSP00203":
|
||||||
return (
|
return <HomeBannerTemplate3 key={index} />;
|
||||||
<HomeBannerTemplate3
|
|
||||||
isOnTop={""}
|
|
||||||
spotlightId={""}
|
|
||||||
onScrollTop={""}
|
|
||||||
onScrollShelf={""}
|
|
||||||
homeMainContentsBannerInfos={homeMainContentsBannerInfos}
|
|
||||||
homeTopDisplayInfos={homeTopDisplayInfos}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -80,29 +61,26 @@ export default function HomePanel() {
|
|||||||
setHomeLayoutInfoDetail(homeLayoutInfo.homeLayoutInfo);
|
setHomeLayoutInfoDetail(homeLayoutInfo.homeLayoutInfo);
|
||||||
}
|
}
|
||||||
selectSwitch();
|
selectSwitch();
|
||||||
}, [
|
}, [homeTopDisplayInfos, homeLayoutInfo]);
|
||||||
homeTopDisplayInfos,
|
|
||||||
homeMainContentsBannerInfos,
|
|
||||||
homeLayoutInfo,
|
|
||||||
select,
|
|
||||||
]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TPanel className={css.panelDesign}>
|
<TPanel className={css.panelDesign}>
|
||||||
{homeLayoutInfoDetail &&
|
<Container>
|
||||||
homeLayoutInfoDetail.map((item, index) => {
|
{homeLayoutInfoDetail &&
|
||||||
return item.shptmApphmDspyOptCd == "DSP00101" ? (
|
homeLayoutInfoDetail.map((item, index) => {
|
||||||
selectSwitch()
|
return item.shptmApphmDspyOptCd == "DSP00101" ? (
|
||||||
) : item.shptmApphmDspyOptCd == "DSP00102" ? (
|
selectSwitch(index)
|
||||||
<SubCategory />
|
) : item.shptmApphmDspyOptCd == "DSP00102" ? (
|
||||||
) : item.shptmApphmDspyOptCd == "DSP00105" ? (
|
<SubCategory key={index} />
|
||||||
<BestSeller />
|
) : item.shptmApphmDspyOptCd == "DSP00105" ? (
|
||||||
) : item.shptmApphmDspyOptCd == "DSP00103" ? (
|
<BestSeller key={index} />
|
||||||
<HomeOnSale />
|
) : item.shptmApphmDspyOptCd == "DSP00103" ? (
|
||||||
) : item.shptmApphmDspyOptCd == "DSP00104" ? (
|
<HomeOnSale key={index} />
|
||||||
<PopularShow />
|
) : item.shptmApphmDspyOptCd == "DSP00104" ? (
|
||||||
) : null;
|
<PopularShow key={index} />
|
||||||
})}
|
) : null;
|
||||||
|
})}
|
||||||
|
</Container>
|
||||||
</TPanel>
|
</TPanel>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,30 @@
|
|||||||
import React, { useCallback, useEffect, useState } from "react";
|
import React, {
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useState,
|
||||||
|
} from 'react';
|
||||||
|
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import {
|
||||||
|
useDispatch,
|
||||||
|
useSelector,
|
||||||
|
} from 'react-redux';
|
||||||
|
|
||||||
import VirtualGridList from "@enact/sandstone/VirtualList";
|
import VirtualGridList from '@enact/sandstone/VirtualList';
|
||||||
import { SpotlightContainerDecorator } from "@enact/spotlight/SpotlightContainerDecorator";
|
import {
|
||||||
import Spottable from "@enact/spotlight/Spottable";
|
SpotlightContainerDecorator,
|
||||||
import ri from "@enact/ui/resolution";
|
} from '@enact/spotlight/SpotlightContainerDecorator';
|
||||||
|
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 Container = SpotlightContainerDecorator(
|
const Container = SpotlightContainerDecorator(
|
||||||
{
|
{
|
||||||
leaveFor: { left: "", right: "" },
|
leaveFor: { left: "", right: "" },
|
||||||
@@ -79,10 +89,10 @@ const SubCategory = () => {
|
|||||||
[categoryItemInfos]
|
[categoryItemInfos]
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<Container>
|
<SpottableComponent>
|
||||||
<CategoryNav
|
<CategoryNav
|
||||||
categoryInfos={categoryInfos}
|
categoryInfos={categoryInfos}
|
||||||
currentLgCatCd={currentLgCatCd}
|
currentCategoryCode={currentLgCatCd}
|
||||||
onCategoryNavClick={handleCategoryNav}
|
onCategoryNavClick={handleCategoryNav}
|
||||||
type="home"
|
type="home"
|
||||||
/>
|
/>
|
||||||
@@ -103,7 +113,7 @@ const SubCategory = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</TGrid>
|
</TGrid>
|
||||||
</Container>
|
</SpottableComponent>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user