diff --git a/src/common/components/Button/AmplitudeEventTrack.tsx b/src/common/components/Button/AmplitudeEventTrack.tsx new file mode 100644 index 00000000..620154e2 --- /dev/null +++ b/src/common/components/Button/AmplitudeEventTrack.tsx @@ -0,0 +1,13 @@ +import { track } from '@amplitude/analytics-browser'; +import type { ReactNode } from 'react'; + +interface AmplitudeEventTrackProps { + eventName?: string; // amplitude event name + children: ReactNode; +} + +const AmplitudeEventTrack = ({ eventName, children }: AmplitudeEventTrackProps) => { + return
{text}
diff --git a/src/common/components/Layout/components/Header/Nav/MenuList/index.tsx b/src/common/components/Layout/components/Header/Nav/MenuList/index.tsx
index 251f94fa..f2f855cb 100644
--- a/src/common/components/Layout/components/Header/Nav/MenuList/index.tsx
+++ b/src/common/components/Layout/components/Header/Nav/MenuList/index.tsx
@@ -1,4 +1,4 @@
-import { reset, track } from '@amplitude/analytics-browser';
+import { reset } from '@amplitude/analytics-browser';
import { useEffect, useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
@@ -8,6 +8,7 @@ import { useRecruitingInfo } from 'contexts/RecruitingInfoProvider';
import { dimmedBgVar, menuContainerVar, menuList, menuMobListVar } from './style.css';
import { MENU_ITEMS, MENU_ITEMS_MAKERS } from '../../contants';
import MenuItem from '../MenuItem';
+import AmplitudeEventTrack from '@components/Button/AmplitudeEventTrack';
const MenuList = ({ isMenuOpen, onClickMenuToggle }: { isMenuOpen?: boolean; onClickMenuToggle?: () => void }) => {
const { deviceType } = useDeviceType();
@@ -34,7 +35,6 @@ const MenuList = ({ isMenuOpen, onClickMenuToggle }: { isMenuOpen?: boolean; onC
} = useRecruitingInfo();
const menuItems = isMakers ? MENU_ITEMS_MAKERS : MENU_ITEMS;
const handleLogout = () => {
- track('click-gnb-logout');
reset();
localStorage.removeItem('soptApplyAccessToken');
localStorage.removeItem('soptApplyAccessTokenExpiredTime');
@@ -59,7 +59,9 @@ const MenuList = ({ isMenuOpen, onClickMenuToggle }: { isMenuOpen?: boolean; onC
{menuItems.map(({ text, path, target, amplitudeId }) => (
))}
-
+