[ImagePanel] IF-LGSP-LOG-005 (GNB)

This commit is contained in:
younghoon100.park
2024-06-21 12:44:07 +09:00
parent 56bca002c9
commit 44d100b501
4 changed files with 32 additions and 4 deletions

View File

@@ -280,6 +280,9 @@ export const LOG_MENU = {
FULL_LIVE_CHANNELS: "Full/Live Channels", // completed
FULL_FEATURED_SHOWS: "Full/Featured Shows", // completed
SHOW_ROOM_SHOP_NOW: "Showroom/Shop Now", // completed
SHOW_ROOM_ROOM_THEME: "Showroom/Room Theme", // completed
CHECKOUT: "Checkout/Checkout", // pyh todo, 문의, completed
CHECKOUT_PIN_CODE: "Checkout/PIN Code", // completed
CHECKOUT_ORDER_COMPLETE: "Checkout/Order Complete", // completed

View File

@@ -113,6 +113,7 @@ export default memo(function ImageOverlayContents({
css.darkGradient,
overlayContentsVisible ? css.show : css.hidden
)}
id="dark-gradient"
/>
<SpottableButton

View File

@@ -10,6 +10,7 @@ import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDeco
import { updatePanel } from "../../actions/panelActions";
import CustomImage from "../../components/CustomImage/CustomImage";
import TPanel from "../../components/TPanel/TPanel";
import useLogService from "../../hooks/useLogService";
import { panel_names } from "../../utils/Config";
import ImageOverlayContents from "./ImageOverlayContents/ImageOverlayContents";
import css from "./ImagePanel.module.less";
@@ -39,6 +40,8 @@ const findSelector = (selector, maxAttempts = 5, currentAttempts = 0) => {
};
export default function ImagePanel({ spotlightId, ...rest }) {
const { sendLogGNB } = useLogService();
const dispatch = useDispatch();
const panelInfo = useSelector((state) => state.panels.panels[1]?.panelInfo);
@@ -209,9 +212,9 @@ export default function ImagePanel({ spotlightId, ...rest }) {
const handleClick = useCallback(
(e) => {
if (sideContentsVisible) {
// if (e.target === e.currentTarget) {
setSideContentsVisible(false);
// }
if (e.target.id === "dark-gradient") {
setSideContentsVisible(false);
}
} else {
setOverlayContentsVisible((prev) => !prev);
}
@@ -219,6 +222,13 @@ export default function ImagePanel({ spotlightId, ...rest }) {
[sideContentsVisible]
);
const handleSeletedTab = useCallback(
(nowMenu) => {
sendLogGNB(nowMenu);
},
[sendLogGNB]
);
return (
<TPanel
className={css.tPanel}
@@ -254,6 +264,7 @@ export default function ImagePanel({ spotlightId, ...rest }) {
{sideContentsVisible && (
<ImageSideContents
otherRoomThemeInfos={otherRoomThemeInfos}
handleSeletedTab={handleSeletedTab}
selectedRoomThemeInfo={selectedRoomThemeInfo}
/>
)}

View File

@@ -1,8 +1,9 @@
import React, { memo, useCallback, useState } from "react";
import React, { memo, useCallback, useEffect, useState } from "react";
import TButtonTab, {
LIST_TYPE,
} from "../../../components/TButtonTab/TButtonTab";
import { LOG_MENU } from "../../../utils/Config";
import { $L } from "../../../utils/helperMethods";
import css from "./ImageSideContents.module.less";
import ListEmptyContents from "./ListEmptyContents/ListEmptyContents";
@@ -13,12 +14,24 @@ const tabList = [$L("SHOP NOW"), $L("ROOM THEME")];
export default memo(function ImageSideContents({
otherRoomThemeInfos,
handleSeletedTab,
selectedRoomThemeInfo,
}) {
const [tabIndex, setTabIndex] = useState(0);
const { roomThemeProducts } = selectedRoomThemeInfo;
useEffect(() => {
if (handleSeletedTab) {
const nowMenu =
tabIndex === 0
? LOG_MENU.SHOW_ROOM_SHOP_NOW
: LOG_MENU.SHOW_ROOM_ROOM_THEME;
handleSeletedTab(nowMenu);
}
}, [tabIndex, handleSeletedTab]);
const handleItemClick = useCallback(
({ index }) => {
if (index === tabIndex) {