-
Notifications
You must be signed in to change notification settings - Fork 3
Develop #548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR optimizes component rendering with memoization (useCallback, React.memo), centralizes menu fetching via a new React Query hook (useStoreMenus), and refactors OrderListPage by extracting logic into a custom hook (useOrderListLogic) and presentational components. It includes minor prop renames (id → menuId), type improvements, and path corrections across both admin and user-facing apps. Changes
Sequence Diagram(s)sequenceDiagram
participant OLP as OrderListPage
participant UOL as useOrderListLogic
participant CartStore as CartStore
participant RQ as React Query
participant API as API
participant Modal as SoldOutModal
participant Nav as Navigation
OLP->>UOL: initialize hook
UOL->>CartStore: getCart()
CartStore-->>UOL: cart array
rect rgb(200, 220, 255)
Note over UOL,API: Menu Fetching Phase
UOL->>RQ: useStoreMenuList(storeId)
RQ->>API: getStoreMenus(storeId)
API-->>RQ: menu data
RQ-->>UOL: menus with menuReadDto
end
rect rgb(255, 220, 200)
Note over UOL,Modal: Sold-Out Check & Modal Flow
UOL->>UOL: getSoldOutMenusInCart(cart, menus)
alt Sold-Out Items Found
UOL->>Modal: modal.open()
OLP->>Modal: render SoldOutModal
Modal-->>OLP: user clicks confirm
OLP->>UOL: handleRemoveSoldOutMenus()
UOL->>CartStore: removeFromCart(menuIds)
UOL->>Modal: modal.close()
else No Sold-Out Items
UOL->>Nav: navigate to remittance page
end
end
OLP->>OLP: render with hook state (cart, isAnimatingOut, modal, soldOutMenus)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (18)
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 |
작업 내용
문제점 및 어려움
해결 방안
공유 사항
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.