Skip to content

Commit 2dba05c

Browse files
committed
feat: 홈화면 친구 추가, 친구 삭제, 대화 시작하기 버튼 click 이벤트 할당
1 parent 5530b4b commit 2dba05c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/components/Profile.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SetStateAction } from "react";
22
import { useNavigate } from "react-router-dom";
33
import { authInstance } from "@/api/axios";
44
import { VirtualFriend } from "@/types/virtualFreind";
5+
import trackClickEvent from "@/utils/trackClickEvent";
56

67
interface ProfileProps {
78
info: VirtualFriend;
@@ -12,6 +13,7 @@ const Profile = ({ info, deleteIndex, setVirtualFriendList }: ProfileProps) => {
1213
const navigate = useNavigate();
1314

1415
const handleDelete = async () => {
16+
trackClickEvent("홈", "친구 - 삭제하기 버튼");
1517
const res = await authInstance.delete(
1618
`/api/virtual-friend/${info.virtualFriendId}`
1719
);
@@ -23,6 +25,7 @@ const Profile = ({ info, deleteIndex, setVirtualFriendList }: ProfileProps) => {
2325
};
2426

2527
const handleNavigate = () => {
28+
trackClickEvent("홈", "친구 - 대화 시작하기 버튼");
2629
navigate("/chat", {
2730
state: {
2831
mode: "virtualFriend",

src/components/SubTitle.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useNavigate } from "react-router-dom";
2+
import trackClickEvent from "@/utils/trackClickEvent";
23

34
const SubTitle = ({ mode }: { mode: "빠른대화" | "친구목록" }) => {
45
const navigate = useNavigate();
@@ -16,6 +17,7 @@ const SubTitle = ({ mode }: { mode: "빠른대화" | "친구목록" }) => {
1617

1718
const handleNavigate = () => {
1819
const type = mode === "빠른대화" ? "fastFriend" : "virtualFriend";
20+
trackClickEvent("홈", "친구 추가 버튼");
1921
navigate("/select-info", { state: { type: type } });
2022
};
2123

0 commit comments

Comments
 (0)