feat(pop): 후속 액션 화면 이동 구현 + 입고확정 버튼 선택 상태 피드백
- PopViewerWithModals에 __pop_navigate__ 이벤트 구독 추가 - targetScreenId가 있으면 해당 POP 화면으로 이동 - "back"이면 router.back(), params는 쿼리스트링 전달 - 입고확정 버튼에 카드리스트 선택 상태 시각 피드백 - 미선택: 기본 아이콘/색상 - 선택됨: emerald-600 배경 + 선택 개수 뱃지 - selected_items connectionMeta category를 "event"로 변경하여 자동 매칭 대상 포함
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useCallback, useEffect, useMemo } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -61,6 +62,7 @@ export default function PopViewerWithModals({
|
||||
overrideGap,
|
||||
overridePadding,
|
||||
}: PopViewerWithModalsProps) {
|
||||
const router = useRouter();
|
||||
const [modalStack, setModalStack] = useState<OpenModal[]>([]);
|
||||
const { subscribe, publish } = usePopEvent(screenId);
|
||||
|
||||
@@ -126,11 +128,30 @@ export default function PopViewerWithModals({
|
||||
});
|
||||
});
|
||||
|
||||
const unsubNavigate = subscribe("__pop_navigate__", (payload: unknown) => {
|
||||
const data = payload as {
|
||||
screenId?: string;
|
||||
params?: Record<string, string>;
|
||||
};
|
||||
|
||||
if (!data?.screenId) return;
|
||||
|
||||
if (data.screenId === "back") {
|
||||
router.back();
|
||||
} else {
|
||||
const query = data.params
|
||||
? "?" + new URLSearchParams(data.params).toString()
|
||||
: "";
|
||||
window.location.href = `/pop/screens/${data.screenId}${query}`;
|
||||
}
|
||||
});
|
||||
|
||||
return () => {
|
||||
unsubOpen();
|
||||
unsubClose();
|
||||
unsubNavigate();
|
||||
};
|
||||
}, [subscribe, publish, layout.modals]);
|
||||
}, [subscribe, publish, layout.modals, router]);
|
||||
|
||||
// 최상위 모달만 닫기 (X 버튼, overlay 클릭, ESC)
|
||||
const handleCloseTopModal = useCallback(() => {
|
||||
|
||||
Reference in New Issue
Block a user