Skip to content

맵 페이지 코드 정리#575

Merged
hwangdae merged 4 commits intomainfrom
develop
Jan 22, 2026
Merged

맵 페이지 코드 정리#575
hwangdae merged 4 commits intomainfrom
develop

Conversation

@hwangdae
Copy link
Collaborator

@hwangdae hwangdae commented Jan 22, 2026

작업 내용

맵 페이지 코드 정리

문제점 및 어려움

해결 방안

공유 사항

Summary by CodeRabbit

  • New Features

    • Enhanced location error handling with user-friendly feedback messages
    • Zoom-dependent marker display for improved visibility at different map levels
    • Improved map interaction with location validation inside boundaries
  • Style

    • Updated university polygon styling for better visual contrast
  • Refactor

    • Restructured map management architecture for improved performance and maintainability

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot requested a review from oriNuguri25 January 22, 2026 12:50
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR refactors map-related components and pages to adopt a hook-driven architecture using react-naver-maps hooks, introduces new modular subcomponents for map management (MapCanvas, GeoDataForm, MapControls), adds utility hooks (useMapClick, useMarkerManager, useIsInsidePolygon), and updates marker rendering with zoom-aware visuals. It also includes styling adjustments, enhanced geolocation error handling, and data constant updates.

Changes

Cohort / File(s) Summary
RemittanceWait Page Cleanup
apps/nowait-user/src/pages/order/remittenceWait/RemittanceWaitPage.tsx
Removed empty newline and commented-out src prop; cosmetic/no functional impact.
MapManagePage Refactoring
apps/nowait-user/src/pages/waiting/BoothMapManage/MapManagePage.tsx
Migrated from in-component state (markers, status, geoData, map ref) to modular hook-driven approach; introduced useMap and dedicated subcomponents; delegated marker and interaction logic to hooks.
MapManagePage New Subcomponents
apps/nowait-user/src/pages/waiting/BoothMapManage/components/MapCanvas.tsx,
apps/nowait-user/src/pages/waiting/BoothMapManage/components/GeoDataForm.tsx,
apps/nowait-user/src/pages/waiting/BoothMapManage/components/MapControls.tsx
New components: MapCanvas renders Naver Map with markers and polygon; GeoDataForm parses geo-data input and copies polygon JSON; MapControls exposes action buttons (start, stop, undo, reset, copy).
MapManagePage New Hooks
apps/nowait-user/src/pages/waiting/BoothMapManage/hooks/useMapClick.ts,
apps/nowait-user/src/pages/waiting/BoothMapManage/hooks/useMarkerManager.ts
useMapClick subscribes to map click events and triggers callbacks; useMarkerManager manages marker state (add, undo, reset) and clipboard operations.
MapPage Hook Migration
apps/nowait-user/src/pages/waiting/boothMap/MapPage.tsx
Replaced ref-based local map state with useMap() hook; simplified NaverMap props and MapControlButtons usage.
Booth Marker Components
apps/nowait-user/src/pages/waiting/boothMap/components/BoothMarker.tsx,
apps/nowait-user/src/pages/waiting/boothMap/components/BoothMarkers.tsx
BoothMarker: new memoized component with zoom-aware rendering (small dot vs. large avatar marker); BoothMarkers: refactored to use BoothMarker instead of inline Marker rendering.
Booth Map Component Updates
apps/nowait-user/src/pages/waiting/boothMap/components/MapHeader.tsx,
apps/nowait-user/src/pages/waiting/boothMap/components/UniversityPolygon.tsx
MapHeader: renamed from HomeHeader and removed console.log; UniversityPolygon: styling updates (strokeWeight 2→1, colors adjusted).
Booth Map Control Refactoring
apps/nowait-user/src/pages/waiting/boothMap/components/mapControls/CompassButton.tsx,
apps/nowait-user/src/pages/waiting/boothMap/components/mapControls/MapControls.tsx,
apps/nowait-user/src/pages/waiting/boothMap/components/mapControls/UniversityListModal.tsx
Removed map prop dependency; CompassButton and UniversityListModal now use useMap() hook instead of receiving map via props; MapControls no longer forwards map prop.
Booth Map Hooks
apps/nowait-user/src/pages/waiting/boothMap/hooks/useGeoPolygon.ts,
apps/nowait-user/src/pages/waiting/boothMap/hooks/useIsInsidePolyon.ts,
apps/nowait-user/src/pages/waiting/boothMap/hooks/useMyLocation.ts
useGeoPolygon: minor formatting; useIsInsidePolygon: new hook for polygon containment checking; useMyLocation: enhanced geolocation with error handling and initial getCurrentPosition call.
Data Constants
apps/nowait-user/src/pages/waiting/boothMap/constants/boothPosition.ts,
apps/nowait-user/src/pages/waiting/boothMap/constants/university.ts
boothPosition: key mapping changed (5→24); university: updated third entry (id 1→2, name/logo/coords updated).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Develop #529: Overlapping modifications to the same map/booth components and hooks (MapPage, BoothMarkers, MapControls, useMyLocation, useGeoPolygon).
  • refactor: 축제 맵 코드 정리 #553: Related map refactoring replacing ref-based map and event handling with hook-based approaches (useMap, useMapZoom).
  • polygon 변환 코드 생성 #555: Overlapping polygon conversion and geo-data handling in MapManagePage and geojson export assets.

Suggested reviewers

  • oriNuguri25
  • dgKim1

Poem

🗺️ A map refactored, hooks now reign,
No more state scattered in the main,
Markers click and components flow,
With useMap's hook, the UI's aglow! 🐰✨

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hwangdae hwangdae merged commit 38daff6 into main Jan 22, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant