diff --git a/com.twin.app.shoptime/src/hooks/useLogService.js b/com.twin.app.shoptime/src/hooks/useLogService.js deleted file mode 100644 index 83fdf6b7..00000000 --- a/com.twin.app.shoptime/src/hooks/useLogService.js +++ /dev/null @@ -1,1468 +0,0 @@ -import { useCallback } from "react"; - -import { useDispatch, useSelector } from "react-redux"; - -import { types } from "../actions/actionTypes"; -import { postLog } from "../actions/logActions"; -import { LOG_TP_NO } from "../utils/Config"; -import { formatGMTString } from "../utils/helperMethods"; -import usePrevious from "./usePrevious"; - -export default function useLogService() { - const dispatch = useDispatch(); - - const entryMenu = useSelector((state) => state.common.menu.entryMenu); - const nowMenu = useSelector((state) => state.common.menu.nowMenu); - const menuMovSno = useSelector((state) => state.common.menu.menuMovSno); - - const entryMenuRef = usePrevious(entryMenu); - const menuMovSnoRef = usePrevious(menuMovSno); - const nowMenuRef = usePrevious(nowMenu); - - /** - * IG-LGSP-LOG-001 / Live 시청 이력 - * - * (M) entryMenu 진입 메뉴 - * - * (O) lgCatCd 카테고리 코드 - * - * (O) lgCatNm 카테고리 네임 - * - * (M) linkTpCd 링크 타입 코드 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 네임 - * - * (M) patnrId 파트너 아이디 - * - * (M) showId 쇼 아이디 - * - * (M) showNm 쇼 네임 - * - * (O) vdoTpNm 영상 가로 세로 여부 ("Vertical" or "Horizontal") - * - * (M) watchEndDt 시청 종료 시간 - * - * (M) watchStrtDt 시청 시작 시간 - */ - const sendLogLive = useCallback( - (params, callback) => { - const { logTpNo, patncNm, patnrId, showId, showNm, watchStrtDt } = params; - - if ( - !logTpNo || - !patncNm || - !patnrId || - !showId || - // !showNm || // pyh todo, state liveShowInfos, showNm: null - !watchStrtDt - ) { - console.error("sendLogLive invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: params?.entryMenu ?? entryMenuRef.current, - nowMenu: params?.nowMenu ?? nowMenuRef.current, - watchEndDt: params?.watchEndDt ?? formatGMTString(new Date()), - }; - - if (newParams.watchEndDt !== watchStrtDt) { - dispatch(postLog(newParams)); - - if (callback) { - callback(); - } - } - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IG-LGSP-LOG-002 / VOD 시청 이력 - * - * (M) entryMenu 진입 메뉴 - * - * (O) lgCatCd 카테고리 코드 - * - * (O) lgCatNm 카테고리 이름 - * - * (O) linkTpCd 딥 링크 타입 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) showId 방송 아이디 (media case: prdtId) - * - * (M) showNm 방송 이름 (media case: prdtNm) - * - * (O) vdoTpNm 영상 가로 세로 여부 ("Vertical" or "Horizontal") - * - * (M) watchEndDt 시청 종료 시간 - * - * (M) watchStrtDt 시청 시작 시간 - */ - const sendLogVOD = useCallback( - (params, callback) => { - const { logTpNo, watchStrtDt } = params; - - if (!logTpNo || !watchStrtDt) { - console.error("sendLogLive invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: params?.entryMenu ?? entryMenuRef.current, - nowMenu: params?.nowMenu ?? nowMenuRef.current, - watchEndDt: params?.watchEndDt ?? formatGMTString(new Date()), - }; - - if (newParams.watchEndDt !== watchStrtDt) { - dispatch(postLog(newParams)); - - if (callback) { - callback(); - } - } - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-003 / Curations View 이력 - * - * (O) cnttTpNm 컨텐츠 타입 네임 "show" / "item" - * - * (M) curationId 큐레이션 아이디 - * - * (M) curationNm 큐레이션 네임 - * - * (M) entryMenu 진입 메뉴 - * - * (M) expsOrd 노출 순서 - * - * (O) lgCatCd 카테고리 코드 - * - * (O) lgCatNm 카테고리 네임 - * - * (M) logTpNo 로그 타입 넘버 - * - * (O) linkTpCd 링크 타입 코드 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 네임 - * - * (M) patnrId 파트너 아이디 - * - * (O) sortTpNm 정렬 타입 네임 "popular" / "new" - */ - const sendLogCuration = useCallback( - (params) => { - const { logTpNo } = params; - - if (!logTpNo) { - console.error("sendLogCuration invalid params", params); - return; - } - - const newParams = { - cnttTpNm: params.cnttTpNm ?? "", - curationId: params.curationId ?? "", - curationNm: params.curationNm ?? "", - entryMenu: entryMenuRef.current, - expsOrd: params.expsOrd ?? "", - lgCatCd: params.lgCatCd ?? "", - lgCatNm: params.lgCatNm ?? "", - logTpNo: params.logTpNo ?? "", - linkTpCd: params.linkTpCd ?? "", - nowMenu: nowMenuRef.current, - patncNm: params.patncNm ?? "", - patnrId: params.patnrId ?? "", - sortTpNm: params.sortTpNm ?? "", - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-004 / 2ndLayer 이력 - * - * (O) curationId 큐레이션 아이디 - * - * (O) curationNm 큐레이션 이름 - * - * (M) entryMenu 진입 메뉴 - * - * (O) expsOrd 전시 순번 - * - * (O) lgCatCd 카테고리 코드 - * - * (O) lgCatNm 카테고리 이름 - * - * (M) linkTpCd 딥 링크 코드 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (O) prdtId 상품 아이디 - * - * (O) prdtNm 상품 이름 - * - * (O) showId 방송 아이디 - * - * (O) showNm 방송 이름 - */ - const sendLogSecondLayer = useCallback( - (params) => { - const { entryMenu } = params; - - if (!entryMenu) { - console.error("sendLogSecondLayer invalid params", params); - return; - } - - dispatch({ type: types.SET_GNB_MENU, payload: entryMenu }); - dispatch(postLog(params)); - }, - [dispatch] - ); - - /** - * IF-LGSP-LOG-005 / GNB 클릭 이력 - * - * (M) entryMenu 진입 메뉴 - * - * (M) inDt 진입 시간 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) menuMovSno 메뉴 이동 일련번호 - * - * (M) nowMenu 현재 메뉴 - * - * (M) outDt 진출 시간 - */ - const sendLogGNB = useCallback( - (menu) => { - if (!menu) { - console.error("sendLogGNB invalid params", menu); - return; - } - - if ( - menu === nowMenuRef.current || - menuMovSnoRef.current === null || - menuMovSnoRef.current === undefined - ) { - return; - } - - const newParams = { - entryMenu: nowMenuRef.current, // previous nowMenu - inDt: formatGMTString(new Date()), - logTpNo: LOG_TP_NO.GNB, - menuMovSno: `${menuMovSnoRef.current}`, - nowMenu: menu, - outDt: "", - }; - - dispatch({ type: types.SET_GNB_MENU, payload: menu }); - dispatch(postLog(newParams)); - }, - [dispatch, menuMovSnoRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-006 / 상품 상세 이력 - * - * (M) befPrice 할인 전 가격 - * - * (O) curationId 큐레이션 아이디 - * - * (O) curationNm 큐레이션 이름 - * - * (M) entryMenu 진입 메뉴 - * - * (O) expsOrd 노출 순번 - * - * (M) inDt 진입 시간 - * - * (M) lastPrice 할인 후 가격 - * - * (M) lgCatCd 카테고리 코드 - * - * (M) lgCatNm 카테고리 이름 - * - * (O) linkTpCd 딥 링크 타입 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) outDt 진출 시간 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) prdtId 상품 아이디 - * - * (M) prdtNm 상품 이름 - * - * (O) revwGrd 별점 - * - * (M) rewdAplyFlag 리워드 적용 여부 - * - * (M) tsvFlag TSV 여부 - */ - const sendLogProductDetail = useCallback( - (params) => { - const { logTpNo } = params; - - const outDt = - logTpNo === LOG_TP_NO.PRODUCT.PRODUCT_DETAIL_IMAGE - ? "" - : formatGMTString(new Date()); - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - nowMenu: nowMenuRef.current, - outDt, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-007 / Detail 상세 이력 - * - * (O) curationId 큐레이션 아이디 (Theme의 경우 M, Hotel의 경우 O) - * - * (O) curationNm 큐레이션 이름 (Theme의 경우 M, Hotel의 경우 O) - * - * (M) entryMenu 진입 메뉴 - * - * (M) inDt 진입 시간 - * - * (O) linkTpCd 딥 링크 타입 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) outDt 진출 시간 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - */ - const sendLogDetail = useCallback( - (params) => { - const { logTpNo, patncNm, patnrId } = params; - - if (!logTpNo || !patncNm || !patnrId) { - console.error("sendLogDetail invalid params", params); - return; - } - - const outDt = - logTpNo === LOG_TP_NO.DETAIL.DETAIL_BUTTON_CLICK - ? "" - : formatGMTString(new Date()); - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - nowMenu: nowMenuRef.current, - outDt, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-008 / Shop by mobile 이력 - * - * (M) befPrice 할인 전 가격 - * - * (O) curationId 큐레이션 아이디 - * - * (O) curationNm 큐레이션 이름 - * - * (M) entryMenu 진입 메뉴 - * - * (O) evntId 이벤트 아이디 - * - * (O) evntNm 이벤트 이름 - * - * (M) lastPrice 할인 후 가격 - * - * (O) lgCatCd 카테고리 코드 - * - * (O) lgCatNm 카테고리 이름 - * - * (O) liveFlag 라이브 여부 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) mbphNoFlag 전화 번호 여부 (모바일 폰 넘버 플래그) - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (O) prdtId 상품 아이디 - * - * (O) prdtNm 상품 이름 - * - * (O) revwGrd 별점 (리뷰 그레이드) - * - * (M) rewdAplyFlag 리워드 적용 여부 - * - * (M) shopByMobileFlag 샵 바이 모바일 여부 - * - * (M) shopTpNm 샵 바이 모바일 타입 이름 - * - * (O) showId 방송 아이디 - * - * (O) showNm 방송 이름 - * - * (M) trmsAgrFlag 약관 동의 여부 - * - * (M) tsvFlag TSV 여부 - */ - const sendLogShopByMobile = useCallback( - (params) => { - const { logTpNo } = params; - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-009 / Partners 클릭 이력 - * - * (M) entryMenu 진입 메뉴 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 네임 - * - * (M) patnrId 파트너 아이디 - */ - const sendLogPartners = useCallback( - (params) => { - const { patncNm, patnrId } = params; - - if (!patncNm || !patnrId) { - console.error("sendLogPartners invalid params", params); - return; - } - - const newParams = { - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.PARTNERS, - nowMenu: nowMenuRef.current, - patncNm, - patnrId, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-010 / Reminder - Alert On/Off - * - * (M) alertFlag 설정 여부, On / Off - * - * (M) entryMenu 진입 메뉴 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - */ - const sendLogMyPageAlertFlag = useCallback( - (params) => { - const { alertFlag } = params; - - if (!alertFlag) { - console.error("sendLogMyPageAlertFlag invalid params", params); - return; - } - - const newParams = { - alertFlag, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.MY_PAGE_ALERT_FLAG, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-011 / My Page Delete 버튼 클릭 이력 - * - * (M) cnt 삭제 개수 - * - * (M) entryMenu 진입 메뉴 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - */ - const sendLogMyPageMyDelete = useCallback( - (params) => { - const { cnt } = params; - - if (!cnt) { - console.error("sendLogMyPageMyDelete invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.MY_PAGE_MY_DELETE, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-012 / My Page Notice View - * - * (M) entryMenu 진입 메뉴 - * - * (M) itemId Notice/FAQ 등록 번호 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMneu 현재 메뉴 - * - * (M) title Notice/FAQ 제목 - */ - const sendLogMyPageNotice = useCallback( - (params) => { - const { itemId, title } = params; - - if (!itemId || !title) { - console.error("sendLogNoticeView invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.MY_PAGE_NOTICE, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-013 / 검색 이력 - * - * (M) entryMenu 진입 메뉴 - * - * (M) inputFlag 입력 구분, keyword / input - * - * (M) itemCnt 상춤 개수 - * - * (M) keyword 검색어 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) showCnt 영상 개수 - * - * (M) themeCnt 테마 개수 - */ - const sendLogSearch = useCallback( - (params) => { - const { inputFlag, itemCnt, keyword, showCnt, themeCnt } = params; - - if (!inputFlag || !itemCnt || !keyword || !showCnt || !themeCnt) { - console.error("sendLogSearch invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.SEARCH, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-014 / 검색 결과 클릭 이력 - * - * (M) curationId 큐레이션 아이디 - * - * (M) curationNm 큐레이션 이름 - * - * (M) dcAfPrice 할인후 가격 - * - * (M) entryMenu 진입 메뉴 - * - * (M) keyword 검색어 - * - * (M) lgCatNm LG 카테고리 이름 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) prdtId 상품 아이디 - * - * (M) prdtNm 상품 이름 - * - * (M) showId 방송 아이디 - * - * (M) showNm 방송 이름 - */ - const sendLogSearchClick = useCallback( - (params) => { - const { keyword, patncNm, patnrId } = params; - - if (!keyword || !patncNm || !patnrId) { - console.error("sendLogSearchClick invalid params", params); - return; - } - - const newParams = { - curationId: params?.curationId ?? "", - curationNm: params?.curationNm ?? "", - dcAfPrice: params?.dcAfPrice ?? "", - entryMenu: entryMenuRef.current, - keyword, - lgCatNm: params?.lgCatNm ?? "", - logTpNo: LOG_TP_NO.SEARCH_CLICK, - nowMenu: nowMenuRef.current, - patncNm, - patnrId, - prdtId: params?.prdtId ?? "", - prdtNm: params?.prdtNm ?? "", - showId: params?.showId ?? "", - showNm: params?.showNm ?? "", - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-015 / Upcoming On/Off - * - * (M) alertFlag 알림 설정 여부 On/Off - * - * (M) entryMenu 진입 메뉴 - * - * (O) hstNm 호스트 이름 - * - * (M) logTpNo 로그 타입 넘버 - * - * (O) lgCatCd 카테고리 코드 - * - * (O) lgCatNm 카테고리 이름 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) remainSec 남은 시간(초) - * - * (M) showId 방송 아이디 - * - * (M) showNm 방송 이름 - */ - const sendLogUpcomingFlag = useCallback( - (params) => { - // pyh Todo, 왜 키가 문서와 맞지 않고 1.0과 같은가..? - // const { alertFlag, patncNm, patnrId, remainSec, showId, showNm } = params; - - // if ( - // !alertFlag || - // !patncNm || - // !patnrId || - // !remainSec || - // !showId || - // !showNm - // ) { - // console.error("sendLogUpcomingFlag invalid params", params); - // return; - // } - - const { items } = params; - - if (!items) { - console.error("sendLogUpcomingFlag invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - // hstNm: params?.hstNm ?? "", - logTpNo: LOG_TP_NO.UPCOMING_FLAG, - // lgCatCd: params?.lgCatCd ?? "", - // lgCatNm: params?.lgCatNm ?? "", - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-017 / 알람 팝업 - * - * (M) alarmDt 알람 방생 시간 - * - * (M) alarmType 알람 유형 Upcoming/Keyword - * - * (M) cnt 키워드 개수 - * - * (M) entryMenu 진입 메뉴 - * - * (O) hstNm 호스트 이름 - * - * (M) keywordList 키워드 리스트 (콤마 구분자) - * - * (O) lgCatCd 카테고리 코드 - * - * (O) lgCatNm 카테고리 이름 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) showId 방송 아이디 - * - * (M) showNm 방송 이름 - */ - const sendLogAlarmPop = useCallback( - (params) => { - const { alarmDt, alarmType, cnt, patncNm, patnrId, showId, showNm } = - params; - - if ( - !alarmDt || - !alarmType || - !cnt || - !patncNm || - !patnrId || - !showId || - !showNm - ) { - console.error("sendLogAlarmPop invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - hstNm: params?.hstNm ?? "", - lgCatCd: params?.lgCatCd ?? "", - lgCatNm: params?.lgCatNm ?? "", - logTpNo: LOG_TP_NO.ALARM_POP, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-018 / 알람 팝업 OK/NO 클릭 - * - * (M) alarmDt 알람 발생 시간 - * - * (M) alarmType 알람 유형 Upcoming/Keyword - * - * (M) clickFlag 클릭 유형 Ok/No - * - * (M) cnt 키워드 개수 - * - * (M) entryMenu 진입 메뉴 - * - * (O) hstNm 호스트 이름 - * - * (M) keywordList 키워드 리스트(콤마 구분자) - * - * (O) lgCatCd 카테고리 코드 - * - * (O) lgCatNm 카테고리 이름 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) showId 방송 아이디 - * - * (M) showNm 방송 이름 - */ - const sendLogAlarmClick = useCallback( - (params) => { - const { - alarmDt, - alarmType, - clickFlag, - cnt, - logTpNo, - patncNm, - patnrId, - showId, - showNm, - } = params; - - if ( - !alarmDt || - !alarmType || - !clickFlag || - !cnt || - !logTpNo || - !patncNm || - !patnrId || - !showId || - !showNm - ) { - console.error("sendLogAlarmClick invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - hstNm: params?.hstNm ?? "", - lgCatCd: params?.lgCatCd ?? "", - lgCatNm: params?.lgCatNm ?? "", - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-020 / 테마 상품 클릭 이력 - * - * (M) befPrice 할인 전 가격 - * - * (M) curationId 큐레이션 아이디 - * - * (M) curationNm 큐레이션 이름 - * - * (M) entryMenu 진입 메뉴 - * - * (M) lastPrice 할인 후 가격 - * - * (M) lgCatCd 카테고리 코드 - * - * (M) lgCatNm 카테고리 이름 - * - * (O) linkTpCd 링크 타입 코드 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) prdtExpsOrd 상품 노출 순번 - * - * (M) prdtId 상품 아이디 - * - * (M) prdtNm 상품 이름 - * - * (M) rewdAplyFlag 리워드 적용 여부 - * - * (M) shelfExpsOrd 쉘프 노출 순번 - * - * (M) shelfId 쉘프 아이디 - * - * (M) shelfNm 쉘프 이름 - * - * (M) tsvFlag TSV 여부 - */ - const sendLogThemeProduct = useCallback( - (params) => { - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.THEME_PRODUCT, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-100 / TOP contents 노출 이력 - * - * (M) banrNo 배너 번호 - * - * (M) banrTpNm 배너 유형 이름, Vertical / Horizontal - * - * (M) contId 컨텐츠 아이디 - * - * (M) contNm 컨텐츠 이름 - * - * (M) contTpNm 컨텐츠 타입 이름, live / image / Today's deals - * - * (M) dspyTpNm 디스플레이 유형 이름, Random / Rolling - * - * (M) entryMenu 진입 메뉴 - * - * (M) expsOrd 노출 순서 - * - * (M) inDt 진입 시간 - * - * (M) linkTpCd 딥 링크 타입 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) outDt 진출 시간 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) tmplCd 템플릿 코드 DSP002 01~03 - */ - const sendLogTopContents = useCallback( - (params) => { - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - outDt: formatGMTString(new Date()), - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-101 / 약관 동의, 미동의 클릭 이력 - * - * (M) entryMenu 진입 메뉴 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - */ - const sendLogTerms = useCallback( - (params) => { - const { logTpNo } = params; - - if (!logTpNo) { - console.error("sendLogTerms invalid params", params); - return; - } - - const newParams = { - entryMenu: entryMenuRef.current, - logTpNo, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-102 / LG Account 로그인 이력 - * - * (M) entryMenu 진입 메뉴 - * - * (M) nowMenu 현재 메뉴 - * - * (M) lginTpNm 로그인 타입 이름 TV/ShopTime - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) usrNo 사용자 번호 - */ - const sendLogLgAccountLogin = useCallback( - (params) => { - const { lginTpNm, usrNo } = params; - - if (!lginTpNm || !usrNo) { - console.error("sendLogLgAccountLogin invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.LG_ACCOUNT_LOGIN, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-103 / Order 화면 버튼 클릭 이력 - * - * (M) btnNm 버튼 이름 - * - * (M) entryMenu 진입 메뉴 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - */ - const sendLogOrderBtnClick = useCallback( - (params) => { - const { btnNm } = params; - - if (!btnNm) { - console.error("sendLogOrderBtnClick invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.ORDER_BTN_CLICK, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-104 / Order 취소/반품/교환 이력 (반품/교환 삭제) - * - * (M) entryMenu 진입 메뉴 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) reqRsn 요청 사유 - * - * (M) reqTpNm 요청 유형 이름 ("Cancel", "Return", "Exchange") - * - */ - const sendLogOrderChange = useCallback( - (params) => { - const { reqRsn, reqTpNm } = params; - - if (!reqRsn || !reqTpNm) { - console.error("sendLogOrderChange invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.ORDER_CHANGE, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-108 / 결제 페이지 진입 이력 - * - * (M) cartTpSno 장바구니 구분 일련번호 ("사용자ID_상품ID_일련번호") - * - * (M) cpnSno 쿠폰 일련번호 - * - * (M) cpnTtl 쿠폰 제목 - * - * (M) dcAftrPrc 할인 후 가격 - * - * (M) dcBefPrc 할인 전 가격 - * - * (M) entryMenu 진입 메뉴 - * - * (M) lgCatCd 카테고리 코드 - * - * (M) lgCatNm 카테고리 이름 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) prodId 상품 아이디 - * - * (M) prodNm 상품 이름 - * - * (M) prodOptSno 상품 옵션 일련번호 - * - * (M) qty 수량 - */ - const sendLogPaymentEntry = useCallback( - (params) => { - const { - cartTpSno, - // cpnSno, - // cpnTtl, - dcAftrPrc, - dcBefPrc, - // lgCatCd, - // lgCatNm, - patncNm, - patnrId, - prodId, - prodNm, - qty, - } = params; - - if ( - !cartTpSno || - // !cpnSno || - // !cpnTtl || - !dcAftrPrc || - !dcBefPrc || - // !lgCatCd || - // !lgCatNm || - !patncNm || - !patnrId || - !prodId || - !prodNm || - !qty - ) { - console.error("sendLogPaymentEntry invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.PAYMENT_ENTRY, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-109 / 결제 완료 이력 - * - * (M) cartTpSno 장바구니 구분 일련번호 ("사용자ID_상품ID_일련번호") - * - * (M) cpnSno 쿠폰 일련번호 - * - * (M) cpnTtl 쿠폰 제목 - * - * (M) dcAftrPrc 할인 후 가격 - * - * (M) dcBefPrc 할인 전 가격 - * - * (M) entryMenu 진입 메뉴 - * - * (M) lgCatCd 카테고리 코드 - * - * (M) lgCatNm 카테고리 이름 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 이름 - * - * (M) patnrId 파트너 아이디 - * - * (M) prodId 상품 아이디 - * - * (M) prodNm 상품 이름 - * - * (O) prodOptSno 상품 옵션 일련번호 - * - * (M) qty 수량 - * - * (M) usrNo 사용자 번호 - */ - const sendLogPaymentComplete = useCallback( - (params) => { - const { - cartTpSno, - // cpnSno, - // cpnTtl, - dcAftrPrc, - dcBefPrc, - // lgCatCd, - // lgCatNm, - patncNm, - patnrId, - prodId, - prodNm, - qty, - usrNo, - } = params; - - if ( - !cartTpSno || - // !cpnSno || - // !cpnTtl || - !dcAftrPrc || - !dcBefPrc || - // !lgCatCd || - // !lgCatNm || - !patncNm || - !patnrId || - !prodId || - !prodNm || - !qty || - !usrNo - ) { - console.error("sendLogPaymentComplete invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.PAYMENT_COMPLETE, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-110 / Featured Brands View 이력 - * - * (O) catCd 파트너사 카테고리 코드 - * - * (O) catNm 파트너사 카테고리 네임 - * - * (O) crtrId 크리에이터 아이디 - * - * (O) crtrNm 크리에이터 네임 - * - * (M) entryMenu 진입 메뉴 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - * - * (M) patncNm 파트너 네임 - * - * (M) patnrId 파트너 아이디 - * - * (O) srsId 시리즈 아이디 - * - * (O) srsNm 시리즈 이름 - */ - const sendLogFeaturedBrands = useCallback( - (params) => { - const { patncNm, patnrId } = params; - - if (!patncNm || !patnrId) { - console.error("sendLogFeaturedBrands invalid params", params); - return; - } - - const newParams = { - catCd: params.catCd ?? "", - catNm: params.catNm ?? "", - crtrId: params.crtrId ?? "", - crtrNm: params.crtrNm ?? "", - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.BRANDS, - nowMenu: nowMenuRef.current, - patncNm, - patnrId, - srsId: params.srsId ?? "", - srsNm: params.srsNm ?? "", - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-111 / 카드, 주소 ADD/EDIT 이력 - * - * (M) btnNm 버튼 이름 - * - * (M) etnryMenu 진입 메뉴 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - */ - const sendLogMyInfoEdit = useCallback( - (params) => { - const { btnNm } = params; - - if (!btnNm) { - console.error("sendLogMyInfoEdit invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.MY_INFO_EDIT, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - /** - * IF-LGSP-LOG-112 / Check out 화면 버튼 클릭 이력 - * - * (M) btnNm 버튼 이름 - * - * (M) entryMenu 진입 메뉴 - * - * (M) logTpNo 로그 타입 넘버 - * - * (M) nowMenu 현재 메뉴 - */ - const sendLogCheckOutBtnClick = useCallback( - (params) => { - const { btnNm } = params; - - if (!btnNm) { - console.error("sendLogCheckOutBtnClick invalid params", params); - return; - } - - const newParams = { - ...params, - entryMenu: entryMenuRef.current, - logTpNo: LOG_TP_NO.CHECKOUT_BTN_CLICK, - nowMenu: nowMenuRef.current, - }; - - dispatch(postLog(newParams)); - }, - [dispatch, entryMenuRef, nowMenuRef] - ); - - return { - sendLogLive, - sendLogVOD, - sendLogCuration, - sendLogSecondLayer, - sendLogGNB, - sendLogProductDetail, - sendLogDetail, - sendLogShopByMobile, - sendLogMyPageAlertFlag, - sendLogMyPageMyDelete, - sendLogMyPageNotice, - sendLogSearch, - sendLogSearchClick, - sendLogUpcomingFlag, - sendLogPartners, - sendLogAlarmPop, - sendLogAlarmClick, - sendLogThemeProduct, - sendLogTopContents, - sendLogTerms, - sendLogLgAccountLogin, - sendLogOrderBtnClick, - sendLogOrderChange, - sendLogPaymentEntry, - sendLogPaymentComplete, - sendLogFeaturedBrands, - sendLogMyInfoEdit, - sendLogCheckOutBtnClick, - }; -} diff --git a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/RecommendedShows/RecommendedShowsNav/RecommendedShowsNav.jsx b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/RecommendedShows/RecommendedShowsNav/RecommendedShowsNav.jsx index aeadd07f..8ffdd365 100644 --- a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/RecommendedShows/RecommendedShowsNav/RecommendedShowsNav.jsx +++ b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/RecommendedShows/RecommendedShowsNav/RecommendedShowsNav.jsx @@ -1,6 +1,6 @@ import React, { memo, useEffect, useRef } from "react"; -import { useSelector } from "react-redux"; +import { useSelector, useDispatch} from "react-redux"; import { Job } from "@enact/core/util"; import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator"; @@ -10,10 +10,10 @@ import { } from "@enact/spotlight/src/container"; import TScroller from "../../../../components/TScroller/TScroller"; -import useLogService from "../../../../hooks/useLogService"; import useScrollTo from "../../../../hooks/useScrollTo"; import css from "./RecommendedShowsNav.module.less"; import RecommendedShowsNavItem from "./RecommendedShowsNavItem/RecommendedShowsNavItem"; +import { sendLogFeaturedBrands } from "../../../../actions/logActions"; const Container = SpotlightContainerDecorator( { leaveFor: { right: "" }, enterTo: "last-focused" }, @@ -31,8 +31,7 @@ export default memo(function RecommendedShowsNav({ selectedPatnrId, setSelectedCatCd, }) { - const { sendLogFeaturedBrands } = useLogService(); - + const dispatch = useDispatch(); const { getScrollTo, scrollLeft } = useScrollTo(); const panelInfo = useSelector((state) => state.panels.panels[0]?.panelInfo); @@ -82,12 +81,12 @@ export default memo(function RecommendedShowsNav({ useEffect(() => { if (fromGNB || fromQuickMenu) { logTimerRef.current = setTimeout(() => { - sendLogFeaturedBrands({ + dispatch(sendLogFeaturedBrands({ patnrId: selectedPatnrId, patncNm: selectedPatncNm, catCd: firstCatCdRef.current, catNm: firstCatNmRef.current, - }); + })); }, 500); return () => clearTimeout(logTimerRef.current); @@ -97,7 +96,6 @@ export default memo(function RecommendedShowsNav({ fromQuickMenu, selectedPatnrId, selectedPatncNm, - sendLogFeaturedBrands, ]); return ( diff --git a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/RecommendedShows/RecommendedShowsNav/RecommendedShowsNavItem/RecommendedShowsNavItem.jsx b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/RecommendedShows/RecommendedShowsNav/RecommendedShowsNavItem/RecommendedShowsNavItem.jsx index 3e81c5b5..03f148a5 100644 --- a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/RecommendedShows/RecommendedShowsNav/RecommendedShowsNavItem/RecommendedShowsNavItem.jsx +++ b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/RecommendedShows/RecommendedShowsNav/RecommendedShowsNavItem/RecommendedShowsNavItem.jsx @@ -1,10 +1,10 @@ import React, { useCallback } from "react"; import { useDispatch, useSelector } from "react-redux"; +import { sendLogFeaturedBrands } from "../../../../../actions/logActions"; import { updatePanel } from "../../../../../actions/panelActions"; import TButton, { TYPES } from "../../../../../components/TButton/TButton"; -import useLogService from "../../../../../hooks/useLogService"; import useScrollReset from "../../../../../hooks/useScrollReset"; // import useScrollTopByDistance from "../../../../../hooks/useScrollTopByDistance"; import { panel_names } from "../../../../../utils/Config"; @@ -21,7 +21,6 @@ export default function RecommendedShowsNavItem({ selectedPatncNm, setSelectedCatCd, }) { - const { sendLogFeaturedBrands } = useLogService(); const { handleScrollReset, handleStopScrolling } = useScrollReset( scrollLeft, true @@ -75,12 +74,12 @@ export default function RecommendedShowsNavItem({ ); } - sendLogFeaturedBrands({ + dispatch(sendLogFeaturedBrands({ patnrId: selectedPatnrId ?? panelInfo?.patnrId, patncNm: selectedPatncNm, catNm, catCd: catCd.toString(), - }); + })); setSelectedCatCd(catCd.toString()); }, @@ -91,7 +90,6 @@ export default function RecommendedShowsNavItem({ panelInfo?.patnrId, selectedPatncNm, selectedPatnrId, - sendLogFeaturedBrands, setSelectedCatCd, ] ); diff --git a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Series/SeriesNav/SeriesNav.jsx b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Series/SeriesNav/SeriesNav.jsx index 728081c2..3eaf2dfb 100644 --- a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Series/SeriesNav/SeriesNav.jsx +++ b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Series/SeriesNav/SeriesNav.jsx @@ -12,12 +12,12 @@ import { import { updatePanel } from "../../../../actions/panelActions"; import TButton, { TYPES } from "../../../../components/TButton/TButton"; import TScroller from "../../../../components/TScroller/TScroller"; -import useLogService from "../../../../hooks/useLogService"; import useScrollReset from "../../../../hooks/useScrollReset"; import useScrollTo from "../../../../hooks/useScrollTo"; import { panel_names } from "../../../../utils/Config"; import { $L } from "../../../../utils/helperMethods"; import css from "./SeriesNav.module.less"; +import { sendLogFeaturedBrands } from "../../../../actions/logActions"; const Container = SpotlightContainerDecorator( { leaveFor: { right: "" }, enterTo: "last-focused" }, @@ -38,8 +38,6 @@ export default memo(function SeriesNav({ selectedSeriesId, setSelectedSeriesId, }) { - const { sendLogFeaturedBrands } = useLogService(); - const { getScrollTo, scrollLeft } = useScrollTo(); const { handleScrollReset, handleStopScrolling } = useScrollReset( scrollLeft, @@ -87,12 +85,12 @@ export default memo(function SeriesNav({ useEffect(() => { if (fromGNB || fromQuickMenu) { logTimerRef.current = setTimeout(() => { - sendLogFeaturedBrands({ + dispatch(sendLogFeaturedBrands({ patnrId: selectedPatnrId, patncNm: selectedPatncNm, srsId: "All", srsNm: "All", - }); + })); }, 500); return () => clearTimeout(logTimerRef.current); @@ -102,7 +100,6 @@ export default memo(function SeriesNav({ fromQuickMenu, selectedPatncNm, selectedPatnrId, - sendLogFeaturedBrands, ]); const handleBlur = useCallback( @@ -137,12 +134,12 @@ export default memo(function SeriesNav({ ); } - sendLogFeaturedBrands({ + dispatch(sendLogFeaturedBrands({ patnrId: selectedPatnrId ?? panelInfo?.patnrId, patncNm: selectedPatncNm, srsId: seriesId, srsNm: seriesNm, - }); + })); setSelectedSeriesId(seriesId); }, @@ -151,7 +148,6 @@ export default memo(function SeriesNav({ panelInfo?.patnrId, selectedPatncNm, selectedPatnrId, - sendLogFeaturedBrands, setSelectedSeriesId, ] ); diff --git a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Showroom/ShowroomNav/ShowroomNav.jsx b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Showroom/ShowroomNav/ShowroomNav.jsx index f7c81c74..f22899dc 100644 --- a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Showroom/ShowroomNav/ShowroomNav.jsx +++ b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Showroom/ShowroomNav/ShowroomNav.jsx @@ -1,6 +1,6 @@ import React, { memo, useEffect, useRef } from "react"; -import { useSelector } from "react-redux"; +import { useSelector, useDispatch } from "react-redux"; import { Job } from "@enact/core/util"; import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator"; @@ -10,10 +10,10 @@ import { } from "@enact/spotlight/src/container"; import TScroller from "../../../../components/TScroller/TScroller"; -import useLogService from "../../../../hooks/useLogService"; import useScrollTo from "../../../../hooks/useScrollTo"; import css from "./ShowroomNav.module.less"; import ShowroomNavItem from "./ShowroomNavItem/ShowroomNavItem"; +import { sendLogFeaturedBrands } from "../../../../actions/logActions"; const Container = SpotlightContainerDecorator( { leaveFor: { right: "" }, enterTo: "last-focused" }, @@ -30,7 +30,7 @@ export default memo(function ShowroomNav({ selectedRoomId, setSelectedRoomId, }) { - const { sendLogFeaturedBrands } = useLogService(); + const dispatch = useDispatch(); const { getScrollTo, scrollLeft } = useScrollTo(); @@ -71,12 +71,12 @@ export default memo(function ShowroomNav({ useEffect(() => { if (fromGNB || fromQuickMenu) { logTimerRef.current = setTimeout(() => { - sendLogFeaturedBrands({ + dispatch(sendLogFeaturedBrands({ catCd: firstRoomIdRef.current, catNm: firstRoomNmRef.current, patnrId: selectedPatnrId, patncNm: selectedPatncNm, - }); + })); }, 500); return () => clearTimeout(logTimerRef.current); @@ -86,7 +86,6 @@ export default memo(function ShowroomNav({ fromQuickMenu, selectedPatncNm, selectedPatnrId, - sendLogFeaturedBrands, ]); return ( diff --git a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Showroom/ShowroomNav/ShowroomNavItem/ShowroomNavItem.jsx b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Showroom/ShowroomNav/ShowroomNavItem/ShowroomNavItem.jsx index bd8b4051..dc13bbb5 100644 --- a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Showroom/ShowroomNav/ShowroomNavItem/ShowroomNavItem.jsx +++ b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/Showroom/ShowroomNav/ShowroomNavItem/ShowroomNavItem.jsx @@ -1,10 +1,10 @@ import React, { useCallback } from "react"; import { useDispatch, useSelector } from "react-redux"; +import { sendLogFeaturedBrands } from "../../../../../actions/logActions"; import { updatePanel } from "../../../../../actions/panelActions"; import TButton, { TYPES } from "../../../../../components/TButton/TButton"; -import useLogService from "../../../../../hooks/useLogService"; import useScrollReset from "../../../../../hooks/useScrollReset"; import { panel_names } from "../../../../../utils/Config"; import css from "./ShowroomNavItem.module.less"; @@ -20,7 +20,6 @@ export default function ShowroomNavItem({ selectedRoomId, setSelectedRoomId, }) { - const { sendLogFeaturedBrands } = useLogService(); const { handleScrollReset, handleStopScrolling } = useScrollReset( scrollLeft, true @@ -71,12 +70,12 @@ export default function ShowroomNavItem({ ); } - sendLogFeaturedBrands({ + dispatch(sendLogFeaturedBrands({ catCd: roomId, catNm: roomNm, patnrId: selectedPatnrId, patncNm: selectedPatncNm, - }); + })); setSelectedRoomId(roomId); }, @@ -86,7 +85,6 @@ export default function ShowroomNavItem({ roomNm, selectedPatncNm, selectedPatnrId, - sendLogFeaturedBrands, setSelectedRoomId, ] ); diff --git a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/UpComing/UpComingList/UpComingList.jsx b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/UpComing/UpComingList/UpComingList.jsx index 06ecbab5..616df945 100644 --- a/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/UpComing/UpComingList/UpComingList.jsx +++ b/com.twin.app.shoptime/src/views/FeaturedBrandsPanel/UpComing/UpComingList/UpComingList.jsx @@ -9,12 +9,12 @@ import { setMainLiveUpcomingAlarm } from "../../../../actions/mainActions"; import { getMyUpcomingAlertShow } from "../../../../actions/myPageActions"; import { convertUtcToLocal } from "../../../../components/MediaPlayer/util"; import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList"; -import useLogService from "../../../../hooks/useLogService"; import useScrollTo from "../../../../hooks/useScrollTo"; import { ACTIVE_POPUP } from "../../../../utils/Config"; import { formatGMTString } from "../../../../utils/helperMethods"; import UpComingCard from "./UpComingCard/UpComingCard"; import css from "./UpComingList.module.less"; +import { sendLogUpcomingFlag } from "../../../../actions/logActions"; const getTimeDifferenceInSeconds = (strtDt) => { const isoStrtDt = strtDt.replace(" ", "T"); @@ -39,8 +39,6 @@ export default memo(function UpComingList({ handleItemFocus, selectedPatnrId, }) { - const { sendLogUpcomingFlag } = useLogService(); - const { getScrollTo, scrollLeft } = useScrollTo(); const dispatch = useDispatch(); @@ -144,7 +142,7 @@ export default memo(function UpComingList({ }) ); - sendLogUpcomingFlag({ + dispatch(sendLogUpcomingFlag({ items: [ { alertFlag: isReserved ? "Off" : "On", @@ -158,7 +156,7 @@ export default memo(function UpComingList({ showNm, }, ], - }); + })); alamTimer.current = setTimeout( () => dispatch(getMyUpcomingAlertShow()), @@ -166,7 +164,7 @@ export default memo(function UpComingList({ ); } }, - [alertShows, dispatch, sendLogUpcomingFlag, upcomAlamUseFlag] + [alertShows, dispatch, upcomAlamUseFlag] ); const handleFocus = useCallback(() => { diff --git a/com.twin.app.shoptime/src/views/HomePanel/EventPopUpBanner/EventPopUpBanner.jsx b/com.twin.app.shoptime/src/views/HomePanel/EventPopUpBanner/EventPopUpBanner.jsx index f66be715..0e0139ba 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/EventPopUpBanner/EventPopUpBanner.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/EventPopUpBanner/EventPopUpBanner.jsx @@ -30,7 +30,6 @@ import { pushPanel } from '../../../actions/panelActions'; import { startVideoPlayer } from '../../../actions/playActions'; import MobileSendPopUp from '../../../components/MobileSend/MobileSendPopUp'; import TPopUp from '../../../components/TPopUp/TPopUp'; -import useLogService from '../../../hooks/useLogService'; import { launchMembershipApp } from '../../../lunaSend'; import { ACTIVE_POPUP, @@ -41,6 +40,7 @@ import { } from '../../../utils/Config'; import { $L } from '../../../utils/helperMethods'; import css from '../EventPopUpBanner/EventPopUpBanner.module.less'; +import { sendLogGNB, sendLogShopByMobile } from '../../../actions/logActions'; const Container = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -48,8 +48,6 @@ const Container = SpotlightContainerDecorator( ); export default function EventPopUpBanner() { - const { sendLogGNB, sendLogShopByMobile } = useLogService(); - const dispatch = useDispatch(); const eventPopInfosData = useSelector( @@ -77,8 +75,8 @@ export default function EventPopUpBanner() { const [eventPopData, setEventPopData] = useState({}); useEffect(() => { - sendLogGNB(LOG_MENU.EVENT_POPUP); - }, [sendLogGNB]); + dispatch(sendLogGNB(LOG_MENU.EVENT_POPUP)); + }, []); useEffect(() => { if (eventPopInfosData) { @@ -139,7 +137,7 @@ export default function EventPopUpBanner() { tsvFlag: "N", }; - sendLogShopByMobile(params); + dispatch(sendLogShopByMobile(params)); shopByMobileLogRef.current = params; break; } diff --git a/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx b/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx index ed9a15b6..272b117f 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx @@ -25,11 +25,11 @@ import { startVideoPlayer, } from "../../../actions/playActions"; import CustomImage from "../../../components/CustomImage/CustomImage"; -import useLogService from "../../../hooks/useLogService"; import usePriceInfo from "../../../hooks/usePriceInfo"; import { LOG_MENU, LOG_TP_NO, panel_names } from "../../../utils/Config"; import { $L, formatGMTString } from "../../../utils/helperMethods"; import css from "./RandomUnit.module.less"; +import { sendLogTopContents } from "../../../actions/logActions"; const SpottableComponent = Spottable("div"); @@ -47,8 +47,6 @@ export default function RandomUnit({ }) { const bannerDetailInfos = bannerData.bannerDetailInfos; - const { sendLogTopContents } = useLogService(); - const dispatch = useDispatch(); const curationId = useSelector((state) => state.home?.bannerData?.curationId); @@ -313,9 +311,9 @@ export default function RandomUnit({ tmplCd: shptmTmplCd, }; - return () => sendLogTopContents(params); + return () => dispatch(sendLogTopContents(params)); } - }, [curationId, curtNm, nowMenu, sendLogTopContents, shptmTmplCd]); + }, [curationId, curtNm, nowMenu, shptmTmplCd]); useEffect(() => { if (bannerData) { diff --git a/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RollingUnit.jsx b/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RollingUnit.jsx index dfc8d7ba..197287d6 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RollingUnit.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RollingUnit.jsx @@ -21,12 +21,12 @@ import liveShow from "../../../../assets/images/tag-liveshow.png"; import { pushPanel } from "../../../actions/panelActions"; import { startVideoPlayer } from "../../../actions/playActions"; import CustomImage from "../../../components/CustomImage/CustomImage"; -import useLogService from "../../../hooks/useLogService"; import usePriceInfo from "../../../hooks/usePriceInfo"; import useScrollReset from "../../../hooks/useScrollReset"; import { LOG_MENU, LOG_TP_NO, panel_names } from "../../../utils/Config"; import { formatGMTString } from "../../../utils/helperMethods"; import css from "./RollingUnit.module.less"; +import { sendLogTopContents } from "../../../actions/logActions"; const SpottableComponent = Spottable("div"); @@ -44,8 +44,6 @@ export default function RollingUnit({ const rollingData = bannerData.bannerDetailInfos; const rollingDataLength = bannerData.bannerDetailInfos.length; - const { sendLogTopContents } = useLogService(); - const dispatch = useDispatch(); const curationId = useSelector((state) => state.home?.bannerData?.curationId); @@ -378,7 +376,7 @@ export default function RollingUnit({ return () => { if (arrRef.current.every((number) => number !== startIndex)) { - sendLogTopContents(params); + dispatch(sendLogTopContents(params)); arrRef.current.push(startIndex); } }; @@ -387,7 +385,6 @@ export default function RollingUnit({ curationId, curtNm, nowMenu, - sendLogTopContents, shptmTmplCd, startIndex, ]); diff --git a/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx b/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx index 4a20a583..1c07d15a 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/SubCategory/SubCategory.jsx @@ -19,13 +19,13 @@ import TItemCard, { removeDotAndColon, } from "../../../components/TItemCard/TItemCard"; import TScroller from "../../../components/TScroller/TScroller"; -import useLogService from "../../../hooks/useLogService"; import useScrollReset from "../../../hooks/useScrollReset"; import useScrollTo from "../../../hooks/useScrollTo"; import { LOG_TP_NO, panel_names } from "../../../utils/Config"; import { SpotlightIds } from "../../../utils/SpotlightIds"; import CategoryNav from "../../HomePanel/SubCategory/CategoryNav/CategoryNav"; import css from "../../HomePanel/SubCategory/SubCategory.module.less"; +import { sendLogCuration } from "../../../actions/logActions"; const SpottableComponent = Spottable("div"); const Container = SpotlightContainerDecorator( @@ -57,8 +57,6 @@ const SubCategory = ({ }) => { const dispatch = useDispatch(); - const { sendLogCuration } = useLogService(); - const { getScrollTo, scrollLeft } = useScrollTo(); const { handleScrollReset, handleStopScrolling } = useScrollReset( @@ -172,16 +170,16 @@ const SubCategory = ({ useEffect(() => { if (categoryInfos) { logRef.current = setTimeout(() => { - sendLogCuration({ + dispatch(sendLogCuration({ expsOrd: getExpsOrdByLgCatCd(categoryInfos, currentLgCatCd), lgCatCd: currentLgCatCd, lgCatNm: currentLgCatNm, logTpNo: LOG_TP_NO.CURATION.HOME, - }); + })); }, 300); } return () => clearTimeout(logRef.current); - }, [categoryInfos, sendLogCuration, currentLgCatCd, currentLgCatNm]); + }, [categoryInfos, currentLgCatCd, currentLgCatNm]); const handleBlur = useCallback((itemIndex) => { if (itemIndex === 0) { diff --git a/com.twin.app.shoptime/src/views/HotPicksPanel/HotPicksPanel.jsx b/com.twin.app.shoptime/src/views/HotPicksPanel/HotPicksPanel.jsx index e1c39f33..81b08c88 100644 --- a/com.twin.app.shoptime/src/views/HotPicksPanel/HotPicksPanel.jsx +++ b/com.twin.app.shoptime/src/views/HotPicksPanel/HotPicksPanel.jsx @@ -40,7 +40,6 @@ import MobileSendPopUp from "../../components/MobileSend/MobileSendPopUp"; import TBody from "../../components/TBody/TBody"; import TButton, { TYPES } from "../../components/TButton/TButton"; import TPanel from "../../components/TPanel/TPanel"; -import useLogService from "../../hooks/useLogService"; import usePrevious from "../../hooks/usePrevious"; import useScrollTo from "../../hooks/useScrollTo"; import { launchMembershipApp } from "../../lunaSend"; diff --git a/com.twin.app.shoptime/src/views/ImagePanel/ImagePanel.jsx b/com.twin.app.shoptime/src/views/ImagePanel/ImagePanel.jsx index 7265bfa6..83052539 100644 --- a/com.twin.app.shoptime/src/views/ImagePanel/ImagePanel.jsx +++ b/com.twin.app.shoptime/src/views/ImagePanel/ImagePanel.jsx @@ -10,11 +10,11 @@ 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 { LOG_TP_NO, panel_names } from "../../utils/Config"; import ImageOverlayContents from "./ImageOverlayContents/ImageOverlayContents"; import css from "./ImagePanel.module.less"; import ImageSideContents from "./ImageSideContents/ImageSideContents"; +import { sendLogCuration, sendLogGNB } from "../../actions/logActions"; const Container = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -40,8 +40,6 @@ const findSelector = (selector, maxAttempts = 5, currentAttempts = 0) => { }; export default function ImagePanel({ panelInfo, spotlightId, ...rest }) { - const { sendLogCuration, sendLogGNB } = useLogService(); - const dispatch = useDispatch(); const brandShowroomInfo = useSelector( @@ -115,12 +113,12 @@ export default function ImagePanel({ panelInfo, spotlightId, ...rest }) { }; themeViewTimer.current = setTimeout(() => { - sendLogCuration(params); + dispatch(sendLogCuration(params)); }, 3000); return () => clearTimeout(themeViewTimer.current); } - }, [panelInfo, selectedRoomThemeInfo, sendLogCuration]); + }, [panelInfo, selectedRoomThemeInfo]); useEffect(() => { if (panelInfo) { @@ -251,9 +249,9 @@ export default function ImagePanel({ panelInfo, spotlightId, ...rest }) { const handleSeletedTab = useCallback( (nowMenu) => { - sendLogGNB(nowMenu); + dispatch(sendLogGNB(nowMenu)); }, - [sendLogGNB] + [] ); return ( diff --git a/com.twin.app.shoptime/src/views/IntroPanel/IntroPanel.jsx b/com.twin.app.shoptime/src/views/IntroPanel/IntroPanel.jsx index 38808ad8..88834f9f 100644 --- a/com.twin.app.shoptime/src/views/IntroPanel/IntroPanel.jsx +++ b/com.twin.app.shoptime/src/views/IntroPanel/IntroPanel.jsx @@ -21,11 +21,11 @@ import TButtonTab from "../../components/TButtonTab/TButtonTab"; import TPanel from "../../components/TPanel/TPanel"; import TPopUp from "../../components/TPopUp/TPopUp"; import useDebugKey from "../../hooks/useDebugKey"; -import useLogService from "../../hooks/useLogService"; import * as Config from "../../utils/Config"; import { panel_names } from "../../utils/Config"; import { $L, scaleH, scaleW } from "../../utils/helperMethods"; import css from "./IntroPanel.module.less"; +import { sendLogGNB, sendLogTerms } from "../../actions/logActions"; const Container = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -43,7 +43,6 @@ export default function IntroPanel({ delete rest.panelInfo; useDebugKey({}); - const { sendLogTerms, sendLogGNB } = useLogService(); const dispatch = useDispatch(); const termsData = useSelector((state) => state.home.termsData); const { popupVisible, activePopup } = useSelector( @@ -65,8 +64,8 @@ export default function IntroPanel({ const [currentTerms, setCurrentTerms] = useState(null); useEffect(() => { - sendLogGNB(Config.LOG_MENU.TERMS_CONDITIONS); - }, [sendLogGNB]); + dispatch(sendLogGNB(Config.LOG_MENU.TERMS_CONDITIONS)); + }, []); const handleTermsClick = useCallback( (trmsTpCdList) => { @@ -82,10 +81,10 @@ export default function IntroPanel({ trmsTpCdList === "MST00402" ? Config.LOG_TP_NO.TERMS.TEARMS_CONDITIONS : Config.LOG_TP_NO.TERMS.PRIVACY_POLICY; - sendLogTerms({ logTpNo }); + dispatch(sendLogTerms({ logTpNo })); } }, - [introTermsData, dispatch, sendLogTerms] + [introTermsData, dispatch] ); const onClose = useCallback(() => { @@ -102,16 +101,16 @@ export default function IntroPanel({ }) ); - sendLogTerms({ logTpNo: Config.LOG_TP_NO.TERMS.AGREE }); + dispatch(sendLogTerms({ logTpNo: Config.LOG_TP_NO.TERMS.AGREE })); // dispatch(popPanel(Config.panel_names.INTRO_PANEL)); } - }, [introTermsData, dispatch, sendLogTerms]); + }, [introTermsData, dispatch]); const handleDisagree = useCallback(() => { dispatch(setShowPopup(Config.ACTIVE_POPUP.exitPopup)); - sendLogTerms({ logTpNo: Config.LOG_TP_NO.TERMS.DO_NOT_AGREE }); - }, [dispatch, sendLogTerms]); + dispatch(sendLogTerms({ logTpNo: Config.LOG_TP_NO.TERMS.DO_NOT_AGREE })); + }, [dispatch]); const onExit = useCallback(() => { dispatch(setExitApp()); diff --git a/com.twin.app.shoptime/src/views/MainView/MainView.jsx b/com.twin.app.shoptime/src/views/MainView/MainView.jsx index ad76b2ef..826d5df0 100644 --- a/com.twin.app.shoptime/src/views/MainView/MainView.jsx +++ b/com.twin.app.shoptime/src/views/MainView/MainView.jsx @@ -35,7 +35,6 @@ import PreloadImage from "../../components/PreloadImage/PreloadImage"; import SystemNotification from "../../components/SystemNotification/SystemNotification"; import TabLayout from "../../components/TabLayout/TabLayout"; import TPopUp from "../../components/TPopUp/TPopUp"; -import useLogService from "../../hooks/useLogService"; import usePrevious from "../../hooks/usePrevious"; import * as Config from "../../utils/Config"; import { panel_names } from "../../utils/Config"; @@ -63,6 +62,7 @@ import TrendingNowPanel from "../TrendingNowPanel/TrendingNowPanel"; import VideoTestPanel from "../VideoTestPanel/VideoTestPanel"; import WelcomeEventPanel from "../WelcomeEventPanel/WelcomeEventPanel"; import css from "./MainView.module.less"; +import { sendLogAlarmClick, sendLogAlarmPop, sendLogLive, sendLogVOD } from "../../actions/logActions"; const preloadImages = [ LoadingPreloadImage, @@ -111,8 +111,6 @@ const STRING_CONF = { }; export default function MainView({ className }) { - const { sendLogAlarmPop, sendLogAlarmClick, sendLogLive, sendLogVOD } = - useLogService(); const dispatch = useDispatch(); const httpHeader = useSelector((state) => state.common.httpHeader); const mainIndex = useSelector((state) => state.appData.mainIndex); @@ -353,7 +351,7 @@ export default function MainView({ className }) { strtDt: alarmDt, } = alertItems[0]; - sendLogAlarmPop({ + dispatch(sendLogAlarmPop({ alarmDt, alarmType: "Upcoming", cnt: "0", @@ -365,9 +363,9 @@ export default function MainView({ className }) { patnrId: patnrId.toString(), showId, showNm, - }); + })); } - }, [activePopup, alertItems, sendLogAlarmPop, popupVisible]); + }, [activePopup, alertItems, popupVisible]); // 팝업 30초 후 종료 useEffect(() => { @@ -444,7 +442,7 @@ export default function MainView({ className }) { strtDt: alarmDt, } = alertItems[0]; - sendLogAlarmClick({ + dispatch(sendLogAlarmClick({ alarmDt, alarmType: "Upcoming", clickFlag: "Ok", @@ -458,7 +456,7 @@ export default function MainView({ className }) { patnrId: patnrId.toString(), showId, showNm, - }); + })); dispatch(resetPanels()); dispatch( @@ -474,7 +472,7 @@ export default function MainView({ className }) { clearTimeout(popupTimerRef.current); // 버튼 클릭 시 타이머 제거 popupTimerRef.current = null; } - }, [dispatch, alertItems, sendLogAlarmClick]); + }, [dispatch, alertItems]); const onWatchClose = useCallback(() => { const { @@ -488,7 +486,7 @@ export default function MainView({ className }) { strtDt: alarmDt, } = alertItems[0]; - sendLogAlarmClick({ + dispatch(sendLogAlarmClick({ alarmDt, alarmType: "Upcoming", clickFlag: "No", @@ -502,11 +500,11 @@ export default function MainView({ className }) { patnrId: patnrId.toString(), showId, showNm, - }); + })); setIntervalActive((prev) => !prev); dispatch(setHidePopup()); - }, [alertItems, sendLogAlarmClick, dispatch]); + }, [alertItems, dispatch]); const sendLogIfNeeded = useCallback(() => { if ( @@ -521,8 +519,8 @@ export default function MainView({ className }) { const resetWatchRecord = () => dispatch(changeLocalSettings({ watchRecord: {} })); - sendLog({ ...watchRecordRef.current }, resetWatchRecord); - }, [dispatch, sendLogLive, sendLogVOD, watchRecordRef]); + dispatch(sendLog({ ...watchRecordRef.current }, resetWatchRecord)); + }, [dispatch]); useEffect(() => { if (httpHeader) { diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPagePanel.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPagePanel.jsx index a9abc59a..d6fcdf89 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPagePanel.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPagePanel.jsx @@ -3,7 +3,6 @@ import React, { useEffect } from "react"; import Spotlight from "@enact/spotlight"; import TPanel from "../../components/TPanel/TPanel"; -import useLogService from "../../hooks/useLogService"; import useScrollTo from "../../hooks/useScrollTo"; import { LOG_MENU } from "../../utils/Config"; import { SpotlightIds } from "../../utils/SpotlightIds"; @@ -15,10 +14,11 @@ import RecentlyViewed from "./MyPageSub/RecentlyViewed/RecentlyViewed"; import Reminders from "./MyPageSub/Reminders/Reminders"; import Support from "./MyPageSub/Support/Support"; import TermsOfService from "./MyPageSub/TermsOfService/TermsOfService"; +import { useDispatch } from "react-redux"; +import { sendLogGNB } from "../../actions/logActions"; export default function MyPagePanel({ panelInfo, isOnTop, spotlightId }) { - const { sendLogGNB } = useLogService(); - + const dispatch = useDispatch(); const { menuNm, menuOrd, menuId } = panelInfo || {}; const { getScrollTo, scrollTop } = useScrollTo(); @@ -43,9 +43,9 @@ export default function MyPagePanel({ panelInfo, isOnTop, spotlightId }) { useEffect(() => { if (panelInfo?.menuNm) { - sendLogGNB(LOG_MENU.MY_PAGE + "/" + panelInfo.menuNm); + dispatch(sendLogGNB(LOG_MENU.MY_PAGE + "/" + panelInfo.menuNm)); } - }, [panelInfo?.menuNm, sendLogGNB]); + }, [panelInfo?.menuNm]); return ( diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Favorites/Favorites.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Favorites/Favorites.jsx index a7e20fc3..740815f8 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Favorites/Favorites.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Favorites/Favorites.jsx @@ -21,19 +21,17 @@ import TButton, { TYPES } from "../../../../components/TButton/TButton"; import TCheckBox from "../../../../components/TCheckBox/TCheckBox"; import THeader from "../../../../components/THeader/THeader"; import TVerticalPagenator from "../../../../components/TVerticalPagenator/TVerticalPagenator"; -import useLogService from "../../../../hooks/useLogService"; import usePrevious from "../../../../hooks/usePrevious"; import { panel_names } from "../../../../utils/Config"; import { $L } from "../../../../utils/helperMethods"; import { SpotlightIds } from "../../../../utils/SpotlightIds"; import MyPageItemCard, { SIZES } from "../../MyPageItemCard/MyPageItemCard"; import css from "../Favorites/Favorites.module.less"; +import { sendLogMyPageMyDelete } from "../../../../actions/logActions"; const HeaderButtonContainer = SpotlightContainerDecorator("div"); const ContainerBasic = SpotlightContainerDecorator({ enterTo: null }, "div"); export default function Favorites({ title, panelInfo, isOnTop }) { - const { sendLogMyPageMyDelete } = useLogService(); - const dispatch = useDispatch(); const favoritesDatas = useSelector( @@ -154,9 +152,9 @@ export default function Favorites({ title, panelInfo, isOnTop }) { if (productList.length > 0 || showList.length > 0) { dispatch(deleteMyFavorite({ productList, showList })); - sendLogMyPageMyDelete({ + dispatch(sendLogMyPageMyDelete({ cnt: `${productList.length + showList.length}`, - }); + })); } } @@ -172,7 +170,6 @@ export default function Favorites({ title, panelInfo, isOnTop }) { favoritesDatas, selectedItems, activeDelete, - sendLogMyPageMyDelete, ]); const handleSelectAllToggle = useCallback(() => { diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyInfo/MyInfo.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyInfo/MyInfo.jsx index 5db2c3f1..b519d605 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyInfo/MyInfo.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyInfo/MyInfo.jsx @@ -31,7 +31,6 @@ import TButtonTab, { import THeader from "../../../../components/THeader/THeader"; import TPopUp from "../../../../components/TPopUp/TPopUp"; import TQRCode from "../../../../components/TQRCode/TQRCode"; -import useLogService from "../../../../hooks/useLogService"; import { getLoginUserData } from "../../../../lunaSend"; import * as Config from "../../../../utils/Config"; import { $L, getQRCodeUrl } from "../../../../utils/helperMethods"; @@ -40,6 +39,7 @@ import BillingAddressTab from "./MyInfoTabContents/BillingAddressTab/BillingAddr import CouponTab from "./MyInfoTabContents/CouponTab/CouponTab"; import PaymentTab from "./MyInfoTabContents/PaymentTab/PaymentTab"; import ShippingAddressTab from "./MyInfoTabContents/ShippingAddressTab/ShippingAddressTab"; +import { sendLogLgAccountLogin, sendLogMyInfoEdit } from "../../../../actions/logActions"; const TabContainer = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -76,8 +76,6 @@ export default function MyInfo({ title, cbScrollTo }) { buttonTabList = getButtonTabList(); } - const { sendLogLgAccountLogin, sendLogMyInfoEdit } = useLogService(); - const dispatch = useDispatch(); const { profileNick, userNumber, userId } = useSelector( @@ -109,14 +107,14 @@ export default function MyInfo({ title, cbScrollTo }) { useEffect(() => { if (loginSuccess && userNumber) { - sendLogLgAccountLogin({ + dispatch(sendLogLgAccountLogin({ lginTpNm: "Tv", usrNo: userNumber, - }); + })); setLoginSuccess(false); } - }, [loginSuccess, sendLogLgAccountLogin, userNumber]); + }, [loginSuccess, userNumber]); useEffect(() => { if (panelInfos && panelInfos.panelInfo && panelInfos.panelInfo.tabForced) { @@ -233,10 +231,10 @@ export default function MyInfo({ title, cbScrollTo }) { } else if (tab === 2) { btnNm = "SHIPPING ADDRESS"; } - sendLogMyInfoEdit({ btnNm }); + dispatch(sendLogMyInfoEdit({ btnNm })); dispatch(setShowPopup(Config.ACTIVE_POPUP.qrPopup)); - }, [dispatch, sendLogMyInfoEdit, tab]); + }, [dispatch, tab]); useEffect(() => { Spotlight.focus(); diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/MyOrders.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/MyOrders.jsx index bfb2286f..300b0416 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/MyOrders.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/MyOrders/MyOrders.jsx @@ -53,7 +53,6 @@ import THeader from "../../../../components/THeader/THeader"; import TPopUp from "../../../../components/TPopUp/TPopUp"; import TScroller from "../../../../components/TScroller/TScroller"; import TVerticalPagenator from "../../../../components/TVerticalPagenator/TVerticalPagenator"; -import useLogService from "../../../../hooks/useLogService"; import usePrevious from "../../../../hooks/usePrevious"; import * as Config from "../../../../utils/Config"; import { GET_MY_INFO_ORDER_SEARCH_LIMIT } from "../../../../utils/Config"; @@ -66,6 +65,7 @@ import { SpotlightIds } from "../../../../utils/SpotlightIds"; import NoOrderList from "./components/NoOrderList"; import OrderListCard from "./components/OrderListCard"; import css from "./MyOrders.module.less"; +import { sendLogOrderBtnClick, sendLogOrderChange } from "../../../../actions/logActions"; const Container = SpotlightContainerDecorator("div"); const ListContainer = SpotlightContainerDecorator("div"); @@ -85,7 +85,6 @@ const getButtonTabList = () => { }; export default function MyOrders({ title, panelInfo, isOnTop }) { - const { sendLogOrderBtnClick, sendLogOrderChange } = useLogService(); const buttonTabList = useMemo(() => getButtonTabList(), []); const dispatch = useDispatch(); @@ -416,8 +415,8 @@ export default function MyOrders({ title, panelInfo, isOnTop }) { dispatch(setHidePopup()); dispatch(paymentTotalCancel(params, moveToCancelTab)); - sendLogOrderChange({ reqRsn, reqTpNm }); - }, [dispatch, popup, moveToCancelTab, sendLogOrderChange]); + dispatch(sendLogOrderChange({ reqRsn, reqTpNm })); + }, [dispatch, popup, moveToCancelTab]); useEffect(() => { Spotlight.focus(); @@ -448,9 +447,9 @@ export default function MyOrders({ title, panelInfo, isOnTop }) { const doSendLogOrderBtnClick = useCallback( (btnNm) => { - sendLogOrderBtnClick({ btnNm }); + dispatch(sendLogOrderBtnClick({ btnNm })); }, - [sendLogOrderBtnClick] + [] ); return ( diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/RecentlyViewed/RecentlyViewed.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/RecentlyViewed/RecentlyViewed.jsx index 147c5b1c..8bbbdbc7 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/RecentlyViewed/RecentlyViewed.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/RecentlyViewed/RecentlyViewed.jsx @@ -29,11 +29,11 @@ import TCheckBox from '../../../../components/TCheckBox/TCheckBox'; import THeader from '../../../../components/THeader/THeader'; import TVerticalPagenator from '../../../../components/TVerticalPagenator/TVerticalPagenator'; -import useLogService from '../../../../hooks/useLogService'; import { $L } from '../../../../utils/helperMethods'; import { SpotlightIds } from '../../../../utils/SpotlightIds'; import css from '../RecentlyViewed/RecentlyViewed.module.less'; import RecentlyViewedContents from './RecentlyViewedContents'; +import { sendLogMyPageMyDelete } from '../../../../actions/logActions'; const HeaderButtonContainer = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -41,7 +41,6 @@ const HeaderButtonContainer = SpotlightContainerDecorator( ); export default function RecentlyViewed({ title, panelInfo, isOnTop }) { - const { sendLogMyPageMyDelete } = useLogService(); const [activeDelete, setActiveDelete] = useState(false); const [selectedItems, setSelectedItems] = useState({}); const [selectAll, setSelectAll] = useState(false); @@ -169,9 +168,9 @@ export default function RecentlyViewed({ title, panelInfo, isOnTop }) { dispatch(changeLocalSettings({ recentItems })); if (Object.keys(selectedItems).length - recentItems.length > 0) { - sendLogMyPageMyDelete({ + dispatch(sendLogMyPageMyDelete({ cnt: `${Object.keys(selectedItems).length - recentItems.length}`, - }); + })); } groupByDate(); } @@ -182,7 +181,6 @@ export default function RecentlyViewed({ title, panelInfo, isOnTop }) { selectedItems, activeDelete, localRecentItems, - sendLogMyPageMyDelete, ]); const handleSelectAllToggle = useCallback(() => { diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Reminders/Reminders.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Reminders/Reminders.jsx index e97c4b9f..0db5bccf 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Reminders/Reminders.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Reminders/Reminders.jsx @@ -31,12 +31,12 @@ import TPopUp from '../../../../components/TPopUp/TPopUp'; import TSwitch from '../../../../components/TSwitch/TSwitch'; import TVirtualGridList from '../../../../components/TVirtualGridList/TVirtualGridList'; -import useLogService from '../../../../hooks/useLogService'; import * as Config from '../../../../utils/Config'; import { $L } from '../../../../utils/helperMethods'; import { SpotlightIds } from '../../../../utils/SpotlightIds'; import css from './Reminders.module.less'; import RemindersCard, { SIZES } from './RemindersCard'; +import { sendLogMyPageAlertFlag, sendLogMyPageMyDelete } from '../../../../actions/logActions'; const HeaderButtonContainer = SpotlightContainerDecorator( { @@ -46,7 +46,6 @@ const HeaderButtonContainer = SpotlightContainerDecorator( ); export default function Reminders({ title, cbScrollTo }) { - const { sendLogMyPageAlertFlag, sendLogMyPageMyDelete } = useLogService(); const dispatch = useDispatch(); @@ -81,10 +80,10 @@ export default function Reminders({ title, cbScrollTo }) { dispatch(setMyUpcomingUseAlert({ upcomingAlamUseFlag: flag })); setUseAlarm(!useAlarm); - sendLogMyPageAlertFlag({ + dispatch(sendLogMyPageAlertFlag({ alertFlag: flag === "N" ? "off" : "on", - }); - }, [dispatch, sendLogMyPageAlertFlag, useAlarm]); + })); + }, [dispatch, useAlarm]); const handleDeleteBtnClick = useCallback(() => { if (activeDelete) { @@ -119,7 +118,7 @@ export default function Reminders({ title, cbScrollTo }) { alertShowTimer.current = setTimeout(() => { dispatch(getMyUpcomingAlertShow()); - sendLogMyPageMyDelete({ cnt: `${showList.length}` }); + dispatch(sendLogMyPageMyDelete({ cnt: `${showList.length}` })); }, 200); } } diff --git a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Support/ListContents/ListContents.jsx b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Support/ListContents/ListContents.jsx index b7b4c47b..f88c6524 100644 --- a/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Support/ListContents/ListContents.jsx +++ b/com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/Support/ListContents/ListContents.jsx @@ -10,15 +10,14 @@ import TButton from "../../../../../components/TButton/TButton"; import TButtonScroller from "../../../../../components/TButtonScroller/TButtonScroller"; import TPopUp from "../../../../../components/TPopUp/TPopUp"; import TScroller from "../../../../../components/TScroller/TScroller"; -import useLogService from "../../../../../hooks/useLogService"; import useScrollTo from "../../../../../hooks/useScrollTo"; import { scaleH, scaleW } from "../../../../../utils/helperMethods"; import css from "./ListContents.module.less"; +import { sendLogMyPageNotice } from "../../../../../actions/logActions"; const SpottableComponent = Spottable("li"); export default function ListContents({ selectedTab }) { - const { sendLogMyPageNotice } = useLogService(); const dispatch = useDispatch(); @@ -53,14 +52,14 @@ export default function ListContents({ selectedTab }) { setOpenIdx(idx); setFaqPopUpOpen(true); - sendLogMyPageNotice({ + dispatch(sendLogMyPageNotice({ itemId: `${selectedTab === 0 ? "FAQ/" : "Notice/"}${ listInfos[idx]?.notiNo }`, title: `${selectedTab === 0 ? "FAQ/" : "Notice/"}${ listInfos[idx]?.notiTitl }`, - }); + })); } }, [ @@ -68,7 +67,6 @@ export default function ListContents({ selectedTab }) { currentInfos, faqInfos, noticeInfos, - sendLogMyPageNotice, selectedTab, ] ); diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index e6187ad2..8fc11179 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -40,7 +40,6 @@ import VideoOverlayWithPhoneNumber from "../../components/VideoOverlayWithPhoneN import Media from "../../components/VideoPlayer/Media"; import TReactPlayer from "../../components/VideoPlayer/TReactPlayer"; import { VideoPlayer } from "../../components/VideoPlayer/VideoPlayer"; -import useLogService from "../../hooks/useLogService"; import usePrevious from "../../hooks/usePrevious"; import * as Config from "../../utils/Config"; import { panel_names } from "../../utils/Config"; @@ -51,6 +50,7 @@ import PlayerOverlayQRCode from "./PlayerOverlay/PlayerOverlayQRCode"; import css from "./PlayerPanel.module.less"; import PlayerTabButton from "./PlayerTabContents/TabButton/PlayerTabButton"; import TabContainer from "./PlayerTabContents/TabContaienr"; +import { sendLogGNB, sendLogLive, sendLogVOD } from "../../actions/logActions"; const Container = SpotlightContainerDecorator( { enterTo: "default-element", preserveld: true }, @@ -148,7 +148,6 @@ const PlayerPanel = ({ spotlightId, ...props }) => { - const { sendLogGNB, sendLogLive, sendLogVOD } = useLogService(); const dispatch = useDispatch(); const videoPlayer = useRef(null); const [playListInfo, setPlayListInfo] = useState(""); @@ -229,12 +228,12 @@ const PlayerPanel = ({ useEffect(() => { if (!panelInfo?.modal && panelInfo?.shptmBanrTpNm === "MEDIA") { - sendLogGNB(Config.LOG_MENU.FULL); + dispatch(sendLogGNB(Config.LOG_MENU.FULL)); prevNowMenuRef.current = nowMenuRef.current; - return () => sendLogGNB(prevNowMenuRef.current); + return () => dispatch(sendLogGNB(prevNowMenuRef.current)); } - }, [panelInfo?.modal, panelInfo?.shptmBanrTpNm, sendLogGNB]); + }, [panelInfo?.modal, panelInfo?.shptmBanrTpNm]); useEffect(() => { // case live @@ -395,9 +394,9 @@ const PlayerPanel = ({ }, 10000); return () => { - sendLogLive({ ...liveLogParamsRef.current, watchStrtDt }, () => + dispatch(sendLogLive({ ...liveLogParamsRef.current, watchStrtDt }, () => dispatch(changeLocalSettings({ watchRecord: {} })) - ); + )); setLogStatus((status) => ({ ...status, isModalLiveLogReady: false, @@ -428,9 +427,9 @@ const PlayerPanel = ({ }, 10000); return () => { - sendLogLive({ ...liveLogParamsRef.current, watchStrtDt }, () => + dispatch(sendLogLive({ ...liveLogParamsRef.current, watchStrtDt }, () => dispatch(changeLocalSettings({ watchRecord: {} })) - ); + )); setLogStatus((status) => ({ ...status, isFullLiveLogReady: false, @@ -461,9 +460,9 @@ const PlayerPanel = ({ }, 10000); return () => { - sendLogLive({ ...liveLogParamsRef.current, watchStrtDt }, () => + dispatch(sendLogLive({ ...liveLogParamsRef.current, watchStrtDt }, () => dispatch(changeLocalSettings({ watchRecord: {} })) - ); + )); setLogStatus((status) => ({ ...status, isDetailLiveLogReady: false, @@ -495,9 +494,9 @@ const PlayerPanel = ({ }, 10000); return () => { - sendLogVOD({ ...vodLogParamsRef.current, watchStrtDt }, () => + dispatch(sendLogVOD({ ...vodLogParamsRef.current, watchStrtDt }, () => dispatch(changeLocalSettings({ watchRecord: {} })) - ); + )); setLogStatus((status) => ({ ...status, isModalVodLogReady: false, @@ -528,9 +527,9 @@ const PlayerPanel = ({ }, 10000); return () => { - sendLogVOD({ ...vodLogParamsRef.current, watchStrtDt }, () => + dispatch(sendLogVOD({ ...vodLogParamsRef.current, watchStrtDt }, () => dispatch(changeLocalSettings({ watchRecord: {} })) - ); + )); setLogStatus((status) => ({ ...status, isFullVodLogReady: false, @@ -561,9 +560,9 @@ const PlayerPanel = ({ }, 10000); return () => { - sendLogVOD({ ...vodLogParamsRef.current, watchStrtDt }, () => + dispatch(sendLogVOD({ ...vodLogParamsRef.current, watchStrtDt }, () => dispatch(changeLocalSettings({ watchRecord: {} })) - ); + )); setLogStatus((status) => ({ ...status, isDetailVodLogReady: false, @@ -594,9 +593,9 @@ const PlayerPanel = ({ }, 10000); return () => { - sendLogVOD({ ...mediaLogParamsRef.current, watchStrtDt }, () => + dispatch(sendLogVOD({ ...mediaLogParamsRef.current, watchStrtDt }, () => dispatch(changeLocalSettings({ watchRecord: {} })) - ); + )); setLogStatus((status) => ({ ...status, isModalMediaLogReady: false, @@ -626,9 +625,9 @@ const PlayerPanel = ({ }, 10000); return () => { - sendLogVOD({ ...mediaLogParamsRef.current, watchStrtDt }, () => + dispatch(sendLogVOD({ ...mediaLogParamsRef.current, watchStrtDt }, () => dispatch(changeLocalSettings({ watchRecord: {} })) - ); + )); setLogStatus((status) => ({ ...status, isFullMediaLogReady: false, @@ -654,15 +653,13 @@ const PlayerPanel = ({ nowMenuRef, panelInfo?.modal, panelInfo?.showUrl, - sendLogLive, - sendLogVOD, ]); const handleItemFocus = useCallback( (menu) => { - sendLogGNB(menu); + dispatch(sendLogGNB(menu)); }, - [sendLogGNB] + [] ); const videoVerticalVisible = useMemo(() => { @@ -1638,6 +1635,9 @@ const PlayerPanel = ({ const propsAreEqual = (prev, next) => { const keys = Object.keys(prev); const nextKeys = Object.keys(next); + if(!next.isOnTop){ //ignore event on background + return true; + } if (keys.length !== nextKeys.length) { return false; } diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchPanel.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchPanel.jsx index c0606ebb..c65b665e 100644 --- a/com.twin.app.shoptime/src/views/SearchPanel/SearchPanel.jsx +++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchPanel.jsx @@ -12,7 +12,6 @@ import TBody from "../../components/TBody/TBody"; import TInput, { ICONS, KINDS } from "../../components/TInput/TInput"; import TPanel from "../../components/TPanel/TPanel"; import TVerticalPagenator from "../../components/TVerticalPagenator/TVerticalPagenator"; -import useLogService from "../../hooks/useLogService"; import usePrevious from "../../hooks/usePrevious"; import { LOG_MENU, panel_names } from "../../utils/Config"; import NoSearchResults from "./NoSearchResults/NoSearchResults"; @@ -21,6 +20,7 @@ import css from "./SearchPanel.module.less"; import SearchResults from "./SearchResults/SearchResults"; import { setContainerLastFocusedElement } from "@enact/spotlight/src/container"; import { SpotlightIds } from "../../utils/SpotlightIds"; +import { sendLogGNB } from "../../actions/logActions"; const ContainerBasic = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -29,7 +29,6 @@ const ContainerBasic = SpotlightContainerDecorator( const ITEMS_PER_PAGE = 9; export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) { - const { sendLogGNB } = useLogService(); const dispatch = useDispatch(); const [firstSpot, setFirstSpot] = useState(false); const recommandedKeywords = useSelector( @@ -63,8 +62,8 @@ export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) { ? LOG_MENU.SEARCH_RESULT : LOG_MENU.SEARCH_SEARCH; - sendLogGNB(nowMenu); - }, [searchPerformed, searchQuery, sendLogGNB]); + dispatch(sendLogGNB(nowMenu)); + }, [searchPerformed, searchQuery]); useEffect(() => { if (!searchQuery) { @@ -191,9 +190,9 @@ export default function SearchPanel({ panelInfo, isOnTop, spotlightId }) { const handleItemFocus = useCallback( (nowMenu) => { - sendLogGNB(nowMenu); + dispatch(sendLogGNB(nowMenu)); }, - [sendLogGNB] + [] ); const onFocusedContainerId = useCallback((containerId) => { setFocusedContainerId(containerId); diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchItemCard.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchItemCard.jsx index 5b09af3d..7cc092e8 100644 --- a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchItemCard.jsx +++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchItemCard.jsx @@ -12,12 +12,12 @@ import { import defaultImageItem from "../../../../../assets/images/img-thumb-empty-product@3x.png"; import { pushPanel, updatePanel } from "../../../../actions/panelActions"; import CustomImage from "../../../../components/CustomImage/CustomImage"; -import useLogService from "../../../../hooks/useLogService"; import useScrollTo from "../../../../hooks/useScrollTo"; import { LOG_TP_NO, panel_names } from "../../../../utils/Config"; import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods"; import { SpotlightIds } from "../../../../utils/SpotlightIds"; import css from "./SearchItemCard.module.less"; +import { sendLogSearchClick } from "../../../../actions/logActions"; const ItemContainer = Spottable("div"); @@ -37,8 +37,6 @@ export default memo(function SearchItemCard({ }) { const [firstChk, setFirstChk] = useState(0); - const { sendLogSearchClick } = useLogService(); - const dispatch = useDispatch(); const handleItemClick = useCallback( @@ -88,14 +86,14 @@ export default memo(function SearchItemCard({ }) ); - sendLogSearchClick({ + dispatch(sendLogSearchClick({ dcAfPrice: dcPrice, keyword: searchQueryRef.current, patncNm, patnrId, prdtId, prdtNm: title, - }); + })); }, [ contentId, @@ -104,7 +102,6 @@ export default memo(function SearchItemCard({ idx, patncNm, searchQueryRef, - sendLogSearchClick, title, ] ); diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchShowCard.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchShowCard.jsx index 9d4c5793..ad135fee 100644 --- a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchShowCard.jsx +++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchShowCard.jsx @@ -9,11 +9,11 @@ import defaultShowImage from "../../../../../assets/images/img-thumb-empty-produ import IcLiveShow from "../../../../../assets/images/tag/tag-liveshow.svg"; import { pushPanel, updatePanel } from "../../../../actions/panelActions"; import CustomImage from "../../../../components/CustomImage/CustomImage"; -import useLogService from "../../../../hooks/useLogService"; import { LOG_TP_NO, panel_names } from "../../../../utils/Config"; import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods"; import { SpotlightIds } from "../../../../utils/SpotlightIds"; import css from "./SearchShowCard.module.less"; +import { sendLogSearchClick } from "../../../../actions/logActions"; const CardContainer = Spottable("div"); @@ -30,8 +30,6 @@ export default memo(function SearchShowCard({ }) { const [firstChk, setFirstChk] = useState(0); - const { sendLogSearchClick } = useLogService(); - const dispatch = useDispatch(); const handleShowClick = useCallback( @@ -83,13 +81,13 @@ export default memo(function SearchShowCard({ }) ); - sendLogSearchClick({ + dispatch(sendLogSearchClick({ keyword: searchQueryRef.current, patncNm, patnrId, showId, showNm: title, - }); + })); }, [ contentId, @@ -97,7 +95,6 @@ export default memo(function SearchShowCard({ idx, patncNm, searchQueryRef, - sendLogSearchClick, title, ] ); diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchThemeCard.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchThemeCard.jsx index 54323bde..238d9c9d 100644 --- a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchThemeCard.jsx +++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchCard/SearchThemeCard.jsx @@ -6,11 +6,11 @@ import Spotlight from "@enact/spotlight"; import Spottable from "@enact/spotlight/Spottable"; import { pushPanel, updatePanel } from "../../../../actions/panelActions"; -import useLogService from "../../../../hooks/useLogService"; import { panel_names } from "../../../../utils/Config"; import { getTranslate3dValueByDirection } from "../../../../utils/helperMethods"; import { SpotlightIds } from "../../../../utils/SpotlightIds"; import css from "./SearchThemeCard.module.less"; +import { sendLogSearchClick } from "../../../../actions/logActions"; const ThemeContainer = Spottable("div"); @@ -25,8 +25,6 @@ export default memo(function SearchThemeCard({ ...rest }) { - const { sendLogSearchClick } = useLogService(); - const dispatch = useDispatch(); const [firstChk, setFirstChk] = useState(0); @@ -81,21 +79,19 @@ export default memo(function SearchThemeCard({ }) ); - sendLogSearchClick({ + dispatch(sendLogSearchClick({ curationId, curationNm: title, keyword: searchQueryRef.current, patncNm, patnrId, - }); + })); }, [ contentId, dispatch, idx, patncNm, - searchQueryRef, - sendLogSearchClick, title, ] ); diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchResults.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchResults.jsx index 80b41bbf..7c98a12b 100644 --- a/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchResults.jsx +++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchResults/SearchResults.jsx @@ -5,18 +5,18 @@ import React, { useRef, } from 'react'; -import { useSelector } from 'react-redux'; +import { useSelector, useDispatch } from 'react-redux'; import { Job } from '@enact/core/util'; import Spotlight from '@enact/spotlight'; import SpotlightContainerDecorator from '@enact/spotlight/SpotlightContainerDecorator'; -import useLogService from '../../../hooks/useLogService'; import { $L } from '../../../utils/helperMethods'; import { SpotlightIds } from '../../../utils/SpotlightIds'; import css from './SearchResults.module.less'; import SearchResultsType from './SearchResultsType'; +import { sendLogSearch } from '../../../actions/logActions'; const Container = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -28,8 +28,7 @@ export default memo(function SearchResults({ panelInfo, searchQueryRef, }) { - const { sendLogSearch } = useLogService(); - + const dispatch = useDispatch(); const searchDatas = useSelector((state) => state.search.searchDatas) || {}; const totalCount = useSelector((state) => state.search.totalCount) || {}; @@ -78,13 +77,13 @@ export default memo(function SearchResults({ }; logTimerRef.current = setTimeout(() => { - sendLogSearch(params); + dispatch(sendLogSearch(params)); isRecommendedSearchRef.current = false; }, 300); } return () => clearTimeout(logTimerRef.current); - }, [isRecommendedSearchRef, searchQueryRef, sendLogSearch, totalCount]); + }, [totalCount]); return ( diff --git a/com.twin.app.shoptime/src/views/ThemeCurationPanel/ThemeCurationContents/ThemeCurationProductList/ThemeCurationProductListItem/ThemeCurationProductListItem.jsx b/com.twin.app.shoptime/src/views/ThemeCurationPanel/ThemeCurationContents/ThemeCurationProductList/ThemeCurationProductListItem/ThemeCurationProductListItem.jsx index 1821c9f8..33375ff9 100644 --- a/com.twin.app.shoptime/src/views/ThemeCurationPanel/ThemeCurationContents/ThemeCurationProductList/ThemeCurationProductListItem/ThemeCurationProductListItem.jsx +++ b/com.twin.app.shoptime/src/views/ThemeCurationPanel/ThemeCurationContents/ThemeCurationProductList/ThemeCurationProductListItem/ThemeCurationProductListItem.jsx @@ -6,11 +6,11 @@ import { Spotlight } from "@enact/spotlight"; import { pushPanel, updatePanel } from "../../../../../actions/panelActions"; import TItemCard from "../../../../../components/TItemCard/TItemCard"; -import useLogService from "../../../../../hooks/useLogService"; import usePriceInfo from "../../../../../hooks/usePriceInfo"; import useScrollReset from "../../../../../hooks/useScrollReset"; import { panel_names } from "../../../../../utils/Config"; import css from "./ThemeCurationProductListItem.module.less"; +import { sendLogThemeProduct } from "../../../../../actions/logActions"; export default function ThemeCurationProductListItem({ contentsIndex, @@ -19,8 +19,6 @@ export default function ThemeCurationProductListItem({ shelfProductInfosLength, themeProductInfosItem, }) { - const { sendLogThemeProduct } = useLogService(); - const { handleScrollReset, handleStopScrolling } = useScrollReset( scrollLeft, true @@ -102,7 +100,7 @@ export default function ThemeCurationProductListItem({ tsvFlag: themeProductInfosItem?.todaySpclFlag, }; - sendLogThemeProduct(params); + dispatch(sendLogThemeProduct(params)); }, [ contentsIndex, @@ -111,7 +109,6 @@ export default function ThemeCurationProductListItem({ originalPrice, panelInfo?.linkTpCd, rewardFlag, - sendLogThemeProduct, themeMenuShelfInfo, themeProductInfosItem, ] diff --git a/com.twin.app.shoptime/src/views/ThemeCurationPanel/ThemeCurationPanel.jsx b/com.twin.app.shoptime/src/views/ThemeCurationPanel/ThemeCurationPanel.jsx index 8268682a..b89b33af 100644 --- a/com.twin.app.shoptime/src/views/ThemeCurationPanel/ThemeCurationPanel.jsx +++ b/com.twin.app.shoptime/src/views/ThemeCurationPanel/ThemeCurationPanel.jsx @@ -13,15 +13,14 @@ import THeader from "../../components/THeader/THeader"; import { removeDotAndColon } from "../../components/TItemCard/TItemCard"; import TPanel from "../../components/TPanel/TPanel"; import TVerticalPagenator from "../../components/TVerticalPagenator/TVerticalPagenator"; -import useLogService from "../../hooks/useLogService"; import { LOG_MENU, panel_names } from "../../utils/Config"; import { $L } from "../../utils/helperMethods"; // import { SpotlightIds } from "../../utils/SpotlightIds"; import ThemeCurationContents from "./ThemeCurationContents/ThemeCurationContents"; import css from "./ThemeCurationPanel.module.less"; +import { sendLogGNB } from "../../actions/logActions"; export default function ThemeCurationPanel({ panelInfo, spotlightId }) { - const { sendLogGNB } = useLogService(); const dispatch = useDispatch(); @@ -52,8 +51,8 @@ export default function ThemeCurationPanel({ panelInfo, spotlightId }) { const { banrImgUrl, curationId, shelfInfos } = themeMenuShelfInfo || {}; useEffect(() => { - sendLogGNB(LOG_MENU.THEME_PAGE); - }, [sendLogGNB]); + dispatch(sendLogGNB(LOG_MENU.THEME_PAGE)); + }, []); const handlePreviousButton = useCallback( () => () => { diff --git a/com.twin.app.shoptime/src/views/WelcomeEventPanel/WelcomeEventPanel.jsx b/com.twin.app.shoptime/src/views/WelcomeEventPanel/WelcomeEventPanel.jsx index 3dc8c119..17607122 100644 --- a/com.twin.app.shoptime/src/views/WelcomeEventPanel/WelcomeEventPanel.jsx +++ b/com.twin.app.shoptime/src/views/WelcomeEventPanel/WelcomeEventPanel.jsx @@ -28,10 +28,10 @@ import TButtonScroller from "../../components/TButtonScroller/TButtonScroller"; import TButtonTab from "../../components/TButtonTab/TButtonTab"; import TPanel from "../../components/TPanel/TPanel"; import TPopUp from "../../components/TPopUp/TPopUp"; -import useLogService from "../../hooks/useLogService"; import * as Config from "../../utils/Config"; import { $L, scaleH, scaleW } from "../../utils/helperMethods"; import css from "../WelcomeEventPanel/WelcomeEventPanel.module.less"; +import { sendLogGNB, sendLogShopByMobile } from "../../actions/logActions"; const Container = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -50,7 +50,6 @@ const getShopTpNm = (evntTpCd) => { }; const WelcomeEventPanel = ({ spotlightId }) => { - const { sendLogGNB, sendLogShopByMobile } = useLogService(); const dispatch = useDispatch(); @@ -126,8 +125,8 @@ const WelcomeEventPanel = ({ spotlightId }) => { }, [billCpnSno, dispatch, eventDatas, evntId, evntTpCd, userNumber]); useEffect(() => { - sendLogGNB(Config.LOG_MENU.WELCOME_EVENT); - }, [sendLogGNB]); + dispatch(sendLogGNB(Config.LOG_MENU.WELCOME_EVENT)); + }, []); useEffect(() => { if (eventIssuedStatusSuccess === 0 && eventIssuedStatusSuccess !== null) { @@ -159,7 +158,7 @@ const WelcomeEventPanel = ({ spotlightId }) => { tsvFlag: "N", }; - sendLogShopByMobile(params); + dispatch(sendLogShopByMobile(params)); shopByMobileLogRef.current = params; } else if ( eventIssuedStatusSuccess !== null && @@ -176,7 +175,6 @@ const WelcomeEventPanel = ({ spotlightId }) => { eventInfo?.shptmLnkInfo?.lnkPatnrId, eventIssuedStatusSuccess, evntTpCd, - sendLogShopByMobile, ]); const onClose = useCallback(() => {