[못올린 파일들 업로드]
- TPOPUP KIND추가 - cartgorypanel, 홈 bestseller 에너지 라벨 노출처리때문에 Titemcardnew로 변경. - productallsection. 우측포커스시 버튼 색 변경관련 처리 미상신건 처리.
This commit is contained in:
@@ -1,22 +1,38 @@
|
||||
import React, { useCallback, useEffect, useMemo } from "react";
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
} from 'react';
|
||||
|
||||
import classNames from "classnames";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import classNames from 'classnames';
|
||||
import {
|
||||
useDispatch,
|
||||
useSelector,
|
||||
} from 'react-redux';
|
||||
|
||||
import Alert from "@enact/sandstone/Alert";
|
||||
import Spotlight from "@enact/spotlight";
|
||||
import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator";
|
||||
import Spottable from "@enact/spotlight/Spottable";
|
||||
import Alert from '@enact/sandstone/Alert';
|
||||
import Spotlight from '@enact/spotlight';
|
||||
import SpotlightContainerDecorator
|
||||
from '@enact/spotlight/SpotlightContainerDecorator';
|
||||
import Spottable from '@enact/spotlight/Spottable';
|
||||
|
||||
import defaultImageItem from "../../../assets/images/img-thumb-empty-product@3x.png";
|
||||
import { cancelFocusElement, focusElement } from "../../actions/commonActions";
|
||||
import { SpotlightIds } from "../../utils/SpotlightIds";
|
||||
import CustomImage from "../CustomImage/CustomImage";
|
||||
import TButton from "../TButton/TButton";
|
||||
import css from "../TPopUp/TPopUp.module.less";
|
||||
import { $L, scaleH, scaleW } from "../../utils/helperMethods";
|
||||
import TButtonTab from "../TButtonTab/TButtonTab";
|
||||
import TButtonScroller from "../TButtonScroller/TButtonScroller";
|
||||
import defaultImageItem
|
||||
from '../../../assets/images/img-thumb-empty-product@3x.png';
|
||||
import {
|
||||
cancelFocusElement,
|
||||
focusElement,
|
||||
} from '../../actions/commonActions';
|
||||
import {
|
||||
$L,
|
||||
scaleH,
|
||||
scaleW,
|
||||
} from '../../utils/helperMethods';
|
||||
import { SpotlightIds } from '../../utils/SpotlightIds';
|
||||
import CustomImage from '../CustomImage/CustomImage';
|
||||
import TButton from '../TButton/TButton';
|
||||
import TButtonScroller from '../TButtonScroller/TButtonScroller';
|
||||
import TButtonTab from '../TButtonTab/TButtonTab';
|
||||
import css from '../TPopUp/TPopUp.module.less';
|
||||
|
||||
const Container = SpotlightContainerDecorator(
|
||||
{ enterTo: "default-element" },
|
||||
@@ -46,6 +62,7 @@ const KINDS = [
|
||||
"introTermsPopup",
|
||||
"optionPopup",
|
||||
"eventBannerPopup",
|
||||
"energyPopup",
|
||||
"supportPopup",
|
||||
"exitPopup",
|
||||
"couponPopup",
|
||||
@@ -68,11 +85,10 @@ const KINDS = [
|
||||
];
|
||||
|
||||
export const CONTENT_TYPES = {
|
||||
TERMS: 'terms',
|
||||
DEFAULT: 'default'
|
||||
TERMS: "terms",
|
||||
DEFAULT: "default",
|
||||
};
|
||||
|
||||
|
||||
export default function TPopUp({
|
||||
kind,
|
||||
children,
|
||||
@@ -133,14 +149,16 @@ export default function TPopUp({
|
||||
// }
|
||||
// }, [spotlightId, popupVisible]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (popupVisible) {
|
||||
let focusTarget;
|
||||
if (spotlightId) {
|
||||
// console.log("focusTarget-1", spotlightId);
|
||||
focusTarget = spotlightId;
|
||||
} else if (kind === "introTermsPopup" || contentType === CONTENT_TYPES.TERMS) {
|
||||
} else if (
|
||||
kind === "introTermsPopup" ||
|
||||
contentType === CONTENT_TYPES.TERMS
|
||||
) {
|
||||
// console.log("focusTarget-2", "tPopupBtn1");
|
||||
focusTarget = "tPopupBtn1";
|
||||
} else {
|
||||
@@ -182,7 +200,6 @@ export default function TPopUp({
|
||||
return ButtonContainer;
|
||||
}, [kind]);
|
||||
|
||||
|
||||
// optionalAgreement
|
||||
// 자동으로 Yes/No 버튼 텍스트 설정
|
||||
|
||||
@@ -202,7 +219,9 @@ export default function TPopUp({
|
||||
|
||||
// optionalAgreement일 경우 항상 버튼 표시
|
||||
const shouldShowButtons = useMemo(() => {
|
||||
return hasButton || kind === "optionalAgreement" || kind === "introTermsPopup";
|
||||
return (
|
||||
hasButton || kind === "optionalAgreement" || kind === "introTermsPopup"
|
||||
);
|
||||
}, [hasButton, kind]);
|
||||
|
||||
//-------------------------------------------------------
|
||||
@@ -347,16 +366,18 @@ export default function TPopUp({
|
||||
);
|
||||
}, [termsData, getTermsTitle]);
|
||||
|
||||
|
||||
// 약관 동의 핸들러
|
||||
const handleTermsAgree = useCallback((e) => {
|
||||
const handleTermsAgree = useCallback(
|
||||
(e) => {
|
||||
if (onTermsAgree) {
|
||||
onTermsAgree(e);
|
||||
}
|
||||
if (onClick) {
|
||||
onClick(e);
|
||||
}
|
||||
}, [onTermsAgree, onClick]);
|
||||
},
|
||||
[onTermsAgree, onClick]
|
||||
);
|
||||
|
||||
// 컨텐츠 타입별 렌더링 함수
|
||||
const renderContent = useMemo(() => {
|
||||
@@ -368,7 +389,6 @@ export default function TPopUp({
|
||||
}
|
||||
}, [contentType, children, renderTermsContent]);
|
||||
|
||||
|
||||
return (
|
||||
<Alert
|
||||
open={open}
|
||||
|
||||
@@ -10,6 +10,7 @@ import SpotlightContainerDecorator
|
||||
|
||||
import { pushPanel } from '../../../../actions/panelActions';
|
||||
import TItemCard from '../../../../components/TItemCard/TItemCard';
|
||||
import TItemCardNew from '../../../../components/TItemCard/TItemCard.new';
|
||||
import { panel_names } from '../../../../utils/Config';
|
||||
import { SpotlightIds } from '../../../../utils/SpotlightIds';
|
||||
import NoResultsCategoryItems
|
||||
@@ -54,10 +55,17 @@ export default function ItemContents({ onClick }) {
|
||||
{itemListDatas &&
|
||||
itemListDatasItem.length > 0 &&
|
||||
itemListDatasItem.map((item, index) => {
|
||||
const { imgUrl, offerInfo, patnrId, prdtId, prdtNm, priceInfo } =
|
||||
item;
|
||||
const {
|
||||
imgUrl,
|
||||
offerInfo,
|
||||
patnrId,
|
||||
prdtId,
|
||||
prdtNm,
|
||||
priceInfo,
|
||||
euEnrgLblInfos,
|
||||
} = item;
|
||||
return (
|
||||
<TItemCard
|
||||
<TItemCardNew
|
||||
key={prdtId}
|
||||
imageAlt={prdtId}
|
||||
imageSource={imgUrl}
|
||||
@@ -70,6 +78,7 @@ export default function ItemContents({ onClick }) {
|
||||
label={index * 1 + 1 + " of " + itemListDatas.total}
|
||||
lastLabel=" go to detail, button"
|
||||
data-wheel-point={index >= 5}
|
||||
euEnrgLblInfos={euEnrgLblInfos}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -290,8 +290,8 @@
|
||||
}
|
||||
|
||||
&.active {
|
||||
outline: 2px solid @PRIMARY_COLOR_RED !important;
|
||||
|
||||
background: #4f172c;
|
||||
outline: 2px solid #4f172c;
|
||||
.shopByMobileText {
|
||||
color: white !important;
|
||||
}
|
||||
@@ -410,7 +410,8 @@
|
||||
}
|
||||
|
||||
&.active {
|
||||
border: 4px solid @PRIMARY_COLOR_RED;
|
||||
border: 4px solid #4f172c;
|
||||
background: #4f172c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -229,6 +229,7 @@ const BestSeller = ({
|
||||
patncNm,
|
||||
catNm,
|
||||
foryou,
|
||||
euEnrgLblInfos,
|
||||
},
|
||||
itemIndex
|
||||
) => {
|
||||
@@ -267,6 +268,7 @@ const BestSeller = ({
|
||||
firstLabel={rankText}
|
||||
label={itemIndex * 1 + 1 + " of " + bestSellerNewData.length}
|
||||
lastLabel=" go to detail, button"
|
||||
euEnrgLblInfos={euEnrgLblInfos}
|
||||
>
|
||||
{foryou === true && <Tag text={"For You"} />}
|
||||
</TItemCardNew>
|
||||
|
||||
Reference in New Issue
Block a user