[#26]Refactor: 미사용 코드 정리 및 pages 구조 개편#27
Conversation
- AdminPayments/Matches/Stats, Overview, About, Partners 등 13개 페이지 삭제 - router.jsx에서 미사용 import 및 Route 정의 일괄 제거
- useAnalytics, useConsultations, useCountdown, useDatePreset, useMatches, usePayments 등 삭제된 페이지 전용 hook 제거 - useBuyers, useCompanies (단건 hook 포함 미사용) 제거 - payments/useMyPartners 중복본 제거 (myBusiness/useMyPartners 유지)
- admin, analytics, buyers, companies, consultations, matches, payments 모듈 제거 - apis/index.ts에서 re-export 제거 - apis/endpoints.ts에서 관련 엔드포인트 정의 제거 (auth/partners/myBusiness/escrowPayments만 유지)
- 삭제된 페이지 전용: Badge, Button, Card, CompanyCard, CurrencySelect, Input, IssuedCurrencyGuide, Modal - 사용처 0건 dead 컴포넌트: CompanyResultCard, FeedbackButton
- PaymentDetail, PaymentRequestForm, PaymentVerifyInfo, PaymentComplete를 components/payment 하위로 이동 - pages/payment에는 라우팅되는 PaymentsPage, CreatePayment만 남김 - CreatePayment, PaymentsPage의 import 경로 업데이트
- MyInfo, MyPartnerList를 components/myBusiness 하위로 이동 - pages/myBusiness에는 라우팅되는 MyBusiness만 남김 - MyBusiness의 import 경로 업데이트
- /overview, /partners 링크를 /my-business 탭 라벨로 교체
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthrough지불, 회사, 바이어, 상담, 관리자, 분석, 매치 API 모듈과 관련 훅, 페이지 컴포넌트, UI 컴포넌트를 제거하고 API 재내보내기를 partnersApi/myBusinessApi/escrowPaymentsApi로 업데이트하며 컴포넌트 import 경로를 pages에서 components로 이동하고 라우팅을 새로운 흐름으로 재구성합니다. Changes레거시 아키텍처 제거 및 새로운 구조로 마이그레이션
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/Footer.jsx`:
- Around line 25-26: nav_my_business's second entry (labelKey
"my_business_tab_partner_list") currently points to the same path as the first
entry, causing the partner tab to never open; update the second entry's
destination so it deep-links to the partner tab (e.g., change the "to" value for
the object with labelKey "my_business_tab_partner_list" to the proper deep link
such as "/my-business?tab=partner-list" or "/my-business#partner-list" so the UI
opens the partner-list tab).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6bdafa09-62b8-44a6-a20e-bae15038c92a
📒 Files selected for processing (52)
src/apis/endpoints.tssrc/apis/index.tssrc/apis/modules/admin.tssrc/apis/modules/analytics.tssrc/apis/modules/buyers.tssrc/apis/modules/companies.tssrc/apis/modules/consultations.tssrc/apis/modules/matches.tssrc/apis/modules/payments.tssrc/components/Badge.jsxsrc/components/Button.jsxsrc/components/Card.jsxsrc/components/CompanyCard.jsxsrc/components/CompanyResultCard.jsxsrc/components/CurrencySelect.jsxsrc/components/FeedbackButton.jsxsrc/components/Footer.jsxsrc/components/Input.jsxsrc/components/IssuedCurrencyGuide.jsxsrc/components/Modal.jsxsrc/components/myBusiness/MyInfo.jsxsrc/components/myBusiness/MyPartnerList.jsxsrc/components/payment/PaymentComplete.jsxsrc/components/payment/PaymentDetail.jsxsrc/components/payment/PaymentRequestForm.jsxsrc/components/payment/PaymentVerifyInfo.jsxsrc/hooks/payments/useMyPartners.jssrc/hooks/useAnalytics.jssrc/hooks/useBuyers.jssrc/hooks/useCompanies.jssrc/hooks/useConsultations.jssrc/hooks/useCountdown.jssrc/hooks/useDatePreset.jssrc/hooks/useMatches.jssrc/hooks/usePayments.jssrc/pages/About.jsxsrc/pages/AdminMatches.jsxsrc/pages/AdminPayments.jsxsrc/pages/AdminStats.jsxsrc/pages/BuyerForm.jsxsrc/pages/CompanyInputForm.jsxsrc/pages/CompanyList.jsxsrc/pages/ContactPage.jsxsrc/pages/Overview.jsxsrc/pages/PartnerSearch.jsxsrc/pages/Partners.jsxsrc/pages/PaymentCheckout.jsxsrc/pages/PaymentStatus.jsxsrc/pages/myBusiness/MyBusiness.jsxsrc/pages/payment/CreatePayment.jsxsrc/pages/payment/PaymentsPage.jsxsrc/router.jsx
💤 Files with no reviewable changes (41)
- src/components/Card.jsx
- src/components/CurrencySelect.jsx
- src/apis/index.ts
- src/apis/modules/payments.ts
- src/hooks/useConsultations.js
- src/hooks/useCountdown.js
- src/components/Input.jsx
- src/hooks/useCompanies.js
- src/pages/AdminMatches.jsx
- src/apis/modules/buyers.ts
- src/hooks/useAnalytics.js
- src/apis/modules/matches.ts
- src/components/CompanyCard.jsx
- src/apis/modules/analytics.ts
- src/apis/modules/admin.ts
- src/hooks/usePayments.js
- src/components/Button.jsx
- src/pages/Partners.jsx
- src/apis/modules/companies.ts
- src/apis/modules/consultations.ts
- src/components/Modal.jsx
- src/hooks/useMatches.js
- src/components/CompanyResultCard.jsx
- src/apis/endpoints.ts
- src/pages/CompanyList.jsx
- src/pages/Overview.jsx
- src/pages/PaymentCheckout.jsx
- src/pages/AdminPayments.jsx
- src/pages/About.jsx
- src/pages/AdminStats.jsx
- src/components/Badge.jsx
- src/hooks/useDatePreset.js
- src/components/IssuedCurrencyGuide.jsx
- src/pages/PartnerSearch.jsx
- src/pages/CompanyInputForm.jsx
- src/pages/BuyerForm.jsx
- src/hooks/useBuyers.js
- src/pages/ContactPage.jsx
- src/components/FeedbackButton.jsx
- src/pages/PaymentStatus.jsx
- src/hooks/payments/useMyPartners.js
| { labelKey: "my_business_tab_my_info", to: "/my-business" }, | ||
| { labelKey: "my_business_tab_partner_list", to: "/my-business" }, |
There was a problem hiding this comment.
nav_my_business의 두 번째 링크가 의도 탭으로 직행하지 않습니다.
Line 26의 my_business_tab_partner_list가 Line 25와 동일하게 /my-business로 이동해, 현재 구현상 항상 기본 탭(my-info)으로 열립니다. 라벨 의미와 실제 도착 상태가 달라 UX 혼선이 생깁니다.
제안 패치 (탭 딥링크)
--- a/src/components/Footer.jsx
+++ b/src/components/Footer.jsx
@@
- { labelKey: "my_business_tab_my_info", to: "/my-business" },
- { labelKey: "my_business_tab_partner_list", to: "/my-business" },
+ { labelKey: "my_business_tab_my_info", to: "/my-business?tab=my-info" },
+ { labelKey: "my_business_tab_partner_list", to: "/my-business?tab=partner-list" },--- a/src/pages/myBusiness/MyBusiness.jsx
+++ b/src/pages/myBusiness/MyBusiness.jsx
@@
-import { useState } from "react";
+import { useEffect, useState } from "react";
+import { useLocation } from "react-router-dom";
@@
export default function MyBusiness() {
const { t } = useI18n();
- const [activeTab, setActiveTab] = useState("my-info");
+ const location = useLocation();
+ const getTab = (search) =>
+ new URLSearchParams(search).get("tab") === "partner-list"
+ ? "partner-list"
+ : "my-info";
+ const [activeTab, setActiveTab] = useState(() => getTab(location.search));
+
+ useEffect(() => {
+ setActiveTab(getTab(location.search));
+ }, [location.search]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/components/Footer.jsx` around lines 25 - 26, nav_my_business's second
entry (labelKey "my_business_tab_partner_list") currently points to the same
path as the first entry, causing the partner tab to never open; update the
second entry's destination so it deep-links to the partner tab (e.g., change the
"to" value for the object with labelKey "my_business_tab_partner_list" to the
proper deep link such as "/my-business?tab=partner-list" or
"/my-business#partner-list" so the UI opens the partner-list tab).
🔍 PR 요약
pages/에 누적된 미접근 페이지·라우트·종속 코드를 일괄 제거하고, 잘못된 위치의 sub-view 파일을components/하위로 이동🧾 관련 이슈
🛠️ 주요 변경 사항
pages/payment/→components/payment/(PaymentDetail, PaymentRequestForm, PaymentVerifyInfo, PaymentComplete),pages/myBusiness/→components/myBusiness/(MyInfo, MyPartnerList)/overview,/partners링크를/my-business탭 라벨로 교체🧠 의도 및 배경
pages/디렉토리에 라우트가 아닌 sub-view 컴포넌트(스텝/탭/사이드 패널)가 섞여 있어 "이 파일이 페이지인가 컴포넌트인가" 판단이 어려웠음