diff --git a/src/page/Home/BookmarkContainer.tsx b/src/page/Home/BookmarkContainer.tsx index 51eb3351..40571135 100644 --- a/src/page/Home/BookmarkContainer.tsx +++ b/src/page/Home/BookmarkContainer.tsx @@ -32,7 +32,7 @@ const BookmarkContainer = () => { return ( - + {/* Empty는 북마크 한 것이 없을 때,로그인 안할 때. 보여줄 div */} {bookmarks === undefined && ( diff --git a/src/page/Home/ContentTitleContainer.tsx b/src/page/Home/ContentTitleContainer.tsx index 798385ec..fdedc58d 100644 --- a/src/page/Home/ContentTitleContainer.tsx +++ b/src/page/Home/ContentTitleContainer.tsx @@ -7,12 +7,13 @@ interface TitleContainerProps { text: React.ReactNode; minWidth?: string; detailLink?: string; + linkText?: string; } -const TitleContainer = ({ text, minWidth = "auto", detailLink = "/" }: TitleContainerProps) => { +const TitleContainer = ({ text, minWidth = "auto", detailLink = "/", linkText = "" }: TitleContainerProps) => { const router = useRouter(); const { track } = useClickTracking(); const clickHandler = () => { - track(`${text} 버튼 클릭`); + track(`${linkText} 버튼 클릭`); router.push(`${detailLink}`); }; // 후에 보여줄 페이지 부분. return ( diff --git a/src/page/Home/Navbar.tsx b/src/page/Home/Navbar.tsx index cf24e558..b2d88096 100644 --- a/src/page/Home/Navbar.tsx +++ b/src/page/Home/Navbar.tsx @@ -5,16 +5,19 @@ import HomeIcon from "@/components/icons/HomeIcon"; import NavCommunityIcon from "@/components/icons/NavCommunityIcon"; import NavPersonIcon from "@/components/icons/NavPersonIcon"; import SearchIcon from "@/components/icons/SearchIcon"; +import { useClickTracking } from "@/hooks/useClickTracking"; import { palette } from "@/styles/palette"; import styled from "@emotion/styled"; import Link from "next/link"; -import { usePathname } from "next/navigation"; +import { usePathname, useRouter } from "next/navigation"; import path from "path"; import React, { MouseEventHandler, useState } from "react"; const Navbar = () => { const pathname = usePathname(); + const router = useRouter(); + const { track } = useClickTracking(); // const pages = ['/', '/search/travel', '/myTrip', '/community', '/mypage'] const pages = ["/", "/trip/list", "/myTrip", "/community", "/myPage"]; const icons = [ @@ -56,6 +59,10 @@ const Navbar = () => { return false; }; + const handleNavClick = (page: string) => { + track(`하단 네비게이션 ${page} 버튼 클릭`); + router.push(page); + }; return condition() ? ( @@ -67,12 +74,13 @@ const Navbar = () => { fill: isLinkActive ? `${palette.기본}` : "none", }; return ( - handleNavClick(page)} style={{ width: "49px", height: "48px", + cursor: "pointer", display: "flex", flexDirection: "column", alignItems: "center", @@ -81,7 +89,7 @@ const Navbar = () => { > {React.cloneElement(Icon, iconProps)} {iconNames[idx]} - + ); })} diff --git a/src/page/Home/TripAvailable.tsx b/src/page/Home/TripAvailable.tsx index 6a082b48..b9acb6f2 100644 --- a/src/page/Home/TripAvailable.tsx +++ b/src/page/Home/TripAvailable.tsx @@ -30,6 +30,7 @@ const TripAvailable = () => { 지금 참가 가능한
여행을 소개해요. @@ -43,13 +44,7 @@ const TripAvailable = () => { cutTrips?.map((post, idx) => { return ( - +
clickTrip(post.travelNumber)}> { userName={post.userName} tags={post.tags} daysAgo={daysAgo(post?.createdAt)} - daysLeft={dayjs(post.registerDue, "YYYY-MM-DD").diff( - dayjs().startOf("day"), - "day" - )} + daysLeft={dayjs(post.registerDue, "YYYY-MM-DD").diff(dayjs().startOf("day"), "day")} title={post.title} recruits={post.nowPerson} total={post.maxPerson} diff --git a/src/page/Home/TripRecommendation.tsx b/src/page/Home/TripRecommendation.tsx index e4f34914..f68d614b 100644 --- a/src/page/Home/TripRecommendation.tsx +++ b/src/page/Home/TripRecommendation.tsx @@ -28,6 +28,7 @@ const TripRecommendation = () => { 이런 여행은
어떠세요?