홈패널 접근성 처리
- 베스트셀러.온세일,파퓰러쇼 부분적용
This commit is contained in:
@@ -62,6 +62,7 @@ export default memo(function TItemCard({
|
|||||||
spotlightId,
|
spotlightId,
|
||||||
nonPosition = false,
|
nonPosition = false,
|
||||||
type = TYPES.vertical,
|
type = TYPES.vertical,
|
||||||
|
firstLabel,
|
||||||
label,
|
label,
|
||||||
lastLabel,
|
lastLabel,
|
||||||
...rest
|
...rest
|
||||||
@@ -125,7 +126,9 @@ export default memo(function TItemCard({
|
|||||||
? " Original price " + originalPrice + ", "
|
? " Original price " + originalPrice + ", "
|
||||||
: "";
|
: "";
|
||||||
const lastLabeltext = lastLabel ? lastLabel : "";
|
const lastLabeltext = lastLabel ? lastLabel : "";
|
||||||
|
const firstLabeltext = firstLabel ? firstLabel + " " : "";
|
||||||
const ariaLabel =
|
const ariaLabel =
|
||||||
|
firstLabeltext +
|
||||||
discountLabel +
|
discountLabel +
|
||||||
productName +
|
productName +
|
||||||
discountpriceLabel +
|
discountpriceLabel +
|
||||||
|
|||||||
@@ -148,23 +148,36 @@ const BestSeller = ({ order, scrollTopBody, handleItemFocus }) => {
|
|||||||
offerInfo,
|
offerInfo,
|
||||||
},
|
},
|
||||||
itemIndex
|
itemIndex
|
||||||
) => (
|
) => {
|
||||||
<TItemCard
|
const rankText =
|
||||||
key={prdtId}
|
rankOrd === 1
|
||||||
imageAlt={prdtId}
|
? rankOrd + "st"
|
||||||
imageSource={imgUrl}
|
: rankOrd === 2
|
||||||
priceInfo={priceInfo}
|
? rankOrd + "nd"
|
||||||
productName={prdtNm}
|
: rankOrd === 3
|
||||||
isBestSeller={true}
|
? rankOrd + "rd"
|
||||||
productId={prdtId}
|
: rankOrd + "th";
|
||||||
rank={rankOrd}
|
return (
|
||||||
onFocus={handleFocus(itemIndex)}
|
<TItemCard
|
||||||
onBlur={handleBlur(itemIndex)}
|
key={prdtId}
|
||||||
onClick={handleCardClick(patnrId, prdtId)}
|
imageAlt={prdtId}
|
||||||
offerInfo={offerInfo}
|
imageSource={imgUrl}
|
||||||
spotlightId={"bestsellerItem" + itemIndex}
|
priceInfo={priceInfo}
|
||||||
/>
|
productName={prdtNm}
|
||||||
)
|
isBestSeller={true}
|
||||||
|
productId={prdtId}
|
||||||
|
rank={rankOrd}
|
||||||
|
onFocus={handleFocus(itemIndex)}
|
||||||
|
onBlur={handleBlur(itemIndex)}
|
||||||
|
onClick={handleCardClick(patnrId, prdtId)}
|
||||||
|
offerInfo={offerInfo}
|
||||||
|
spotlightId={"bestsellerItem" + itemIndex}
|
||||||
|
firstLabel={rankText}
|
||||||
|
label={itemIndex * 1 + 1 + " of " + bestSellerDatas.length}
|
||||||
|
lastLabel=" go to detail, button"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{drawChk && (
|
{drawChk && (
|
||||||
@@ -173,6 +186,7 @@ const BestSeller = ({ order, scrollTopBody, handleItemFocus }) => {
|
|||||||
className={css.displayBox}
|
className={css.displayBox}
|
||||||
onClick={handleMoreCardClick}
|
onClick={handleMoreCardClick}
|
||||||
spotlightId={"bestseller-item-more-btn"}
|
spotlightId={"bestseller-item-more-btn"}
|
||||||
|
aria-label="See more button"
|
||||||
></SpottableComponent>
|
></SpottableComponent>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import TScroller from "../../../components/TScroller/TScroller";
|
|||||||
import useScrollReset from "../../../hooks/useScrollReset";
|
import useScrollReset from "../../../hooks/useScrollReset";
|
||||||
import useScrollTo from "../../../hooks/useScrollTo";
|
import useScrollTo from "../../../hooks/useScrollTo";
|
||||||
import useScrollTopByDistance from "../../../hooks/useScrollTopByDistance";
|
import useScrollTopByDistance from "../../../hooks/useScrollTopByDistance";
|
||||||
|
import { LOG_MENU } from "../../../utils/Config";
|
||||||
import { $L, scaleW } from "../../../utils/helperMethods";
|
import { $L, scaleW } from "../../../utils/helperMethods";
|
||||||
import css from "./HomeOnSale.module.less";
|
import css from "./HomeOnSale.module.less";
|
||||||
import HomeOnSaleItem from "./HomeOnSaleItem/HomeOnSaleItem";
|
import HomeOnSaleItem from "./HomeOnSaleItem/HomeOnSaleItem";
|
||||||
import { LOG_MENU } from "../../../utils/Config";
|
|
||||||
|
|
||||||
const Container = SpotlightContainerDecorator(
|
const Container = SpotlightContainerDecorator(
|
||||||
{ enterTo: "last-focused" },
|
{ enterTo: "last-focused" },
|
||||||
@@ -119,6 +119,8 @@ const HomeOnSale = ({ order, scrollTopBody, handleItemFocus, ...rest }) => {
|
|||||||
itemData={itemData}
|
itemData={itemData}
|
||||||
onFocus={handleFocus(index)}
|
onFocus={handleFocus(index)}
|
||||||
onBlur={handleBlur(index)}
|
onBlur={handleBlur(index)}
|
||||||
|
label={index * 1 + 1 + " of " + homeOnSaleInfos.length}
|
||||||
|
lastLabel=" go to detail, button"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -14,7 +14,13 @@ import css from "./HomeOnSaleItem.module.less";
|
|||||||
|
|
||||||
const SpottableComponent = Spottable("div");
|
const SpottableComponent = Spottable("div");
|
||||||
|
|
||||||
export default function HomeOnSaleItem({ homeOnSaleInfos, itemData, ...rest }) {
|
export default function HomeOnSaleItem({
|
||||||
|
homeOnSaleInfos,
|
||||||
|
itemData,
|
||||||
|
label,
|
||||||
|
lastLabel,
|
||||||
|
...rest
|
||||||
|
}) {
|
||||||
const { originalPrice, discountedPrice, discountRate } =
|
const { originalPrice, discountedPrice, discountRate } =
|
||||||
usePriceInfo(itemData.priceInfo) || {};
|
usePriceInfo(itemData.priceInfo) || {};
|
||||||
|
|
||||||
@@ -36,11 +42,31 @@ export default function HomeOnSaleItem({ homeOnSaleInfos, itemData, ...rest }) {
|
|||||||
},
|
},
|
||||||
[dispatch, itemData]
|
[dispatch, itemData]
|
||||||
);
|
);
|
||||||
|
const prdtNum = label ? label : "";
|
||||||
|
const discountLabel = discountRate ? discountRate + " discount," : "";
|
||||||
|
const discountpriceLabel = discountRate
|
||||||
|
? ", Sale price " + discountedPrice
|
||||||
|
: "";
|
||||||
|
const priceLabel = originalPrice
|
||||||
|
? ", Original price " + originalPrice + ", "
|
||||||
|
: "";
|
||||||
|
const lastLabeltext = lastLabel ? lastLabel : "";
|
||||||
|
|
||||||
|
const ariaLabel =
|
||||||
|
discountLabel +
|
||||||
|
itemData.prdtNm +
|
||||||
|
"," +
|
||||||
|
itemData.catNm +
|
||||||
|
discountpriceLabel +
|
||||||
|
priceLabel +
|
||||||
|
prdtNum +
|
||||||
|
lastLabeltext;
|
||||||
return (
|
return (
|
||||||
<SpottableComponent
|
<SpottableComponent
|
||||||
className={css.onSaleItemList}
|
className={css.onSaleItemList}
|
||||||
onClick={() => handleCardClick(itemData)}
|
onClick={() => handleCardClick(itemData)}
|
||||||
spotlightId={"home_onsale_item_" + itemData.prdtId}
|
spotlightId={"home_onsale_item_" + itemData.prdtId}
|
||||||
|
aria-label={ariaLabel}
|
||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
<CustomImage
|
<CustomImage
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ const PopularShow = ({
|
|||||||
patncLogoPath,
|
patncLogoPath,
|
||||||
catNm,
|
catNm,
|
||||||
patnrId,
|
patnrId,
|
||||||
|
patncNm,
|
||||||
catCd,
|
catCd,
|
||||||
showUrl,
|
showUrl,
|
||||||
},
|
},
|
||||||
@@ -186,6 +187,9 @@ const PopularShow = ({
|
|||||||
onFocus={handleFocus(itemIndex)}
|
onFocus={handleFocus(itemIndex)}
|
||||||
onBlur={handleBlur(itemIndex)}
|
onBlur={handleBlur(itemIndex)}
|
||||||
onClick={handleCardClick(patnrId, showId, catCd, showUrl)}
|
onClick={handleCardClick(patnrId, showId, catCd, showUrl)}
|
||||||
|
firstLabel={patncNm + " "}
|
||||||
|
label={itemIndex * 1 + 1 + " of " + topInfos.length}
|
||||||
|
lastLabel=" go to detail, button"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user