fix: 스크롤 기능 추가#115
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request integrates bottom navigation across various pages (such as mypage, search, chat, and notifications) by wrapping them in RouteTabShell. It also updates navigation handlers to use explicit paths instead of router.back(), and applies layout constraints (h-dvh, min-h-0, overflow-hidden) to prevent scrolling issues. The reviewer feedback recommends explicitly importing ProductListType from ../products/index to avoid resolution ambiguity, and safely handling external URLs in the onTargetUrl callback within NotificationsPage to prevent routing errors.
|
|
||
| import AuctionListScreen from "./index"; | ||
| import type { UnifiedSearchResultType } from "@/services/product/search/types"; | ||
| import type { ProductListType } from "../products"; |
There was a problem hiding this comment.
../products와 같이 Next.js의 라우트 디렉토리를 직접 임포트하는 경우, 빌드 환경이나 테스트 도구(Jest 등)에 따라 파일 해소(resolution) 모호성이 발생할 수 있습니다. src/app/products 디렉토리에는 page.tsx와 index.tsx가 공존하고 있으므로, 명확하게 ../products/index에서 타입을 임포트하거나 공통 타입을 별도의 타입 파일로 분리하는 것이 안전합니다.
| import type { ProductListType } from "../products"; | |
| import type { ProductListType } from "../products/index"; |
| onAuctionClick={(id) => router.push(`/auctions/${id}`)} | ||
| onWinningBidClick={() => router.push("/notifications")} | ||
| onOutbidClick={() => router.push("/notifications")} | ||
| onTargetUrl={(url) => router.push(url)} |
There was a problem hiding this comment.
onTargetUrl 콜백에서 router.push(url)을 직접 호출하고 있습니다. 만약 알림의 targetUrl이 외부 링크(예: https://... 또는 http://...)인 경우, Next.js의 router.push는 이를 올바르게 처리하지 못하고 내부 경로로 오인하거나 에러를 발생시킬 수 있습니다.\n\n따라서 URL이 외부 링크인지 확인하는 로직을 추가하여, 외부 링크일 경우 window.location.href를 사용하도록 분기 처리하는 것이 안전합니다.
onTargetUrl={(url) => {\n if (url.startsWith("http://") || url.startsWith("https://")) {\n window.location.href = url;\n } else {\n router.push(url);\n }\n }}
🚀 Summary
✨ Description
🎲 Issue Number
close #114