fix(map): 国宝海外回归按钮支持退出激活的回归路线

激活回归路线后再次点击该按钮可直接退出,不再反复弹出文物选择框;
按钮文案在「N 件 / 退出」间切换。
This commit is contained in:
selfrelease
2026-06-13 21:11:20 +08:00
parent 2d847e154f
commit 3a55cd1978
+8 -2
View File
@@ -705,7 +705,11 @@ export default function MapPage() {
</button> </button>
))} ))}
<button <button
onClick={() => setShowRepatriationPicker(true)} onClick={() =>
activeRoute?.type === "repatriation"
? setActiveRoute(null)
: setShowRepatriationPicker(true)
}
className={`flex w-full items-center justify-between rounded-lg border px-3 py-2 text-xs transition ${ className={`flex w-full items-center justify-between rounded-lg border px-3 py-2 text-xs transition ${
activeRoute?.type === "repatriation" activeRoute?.type === "repatriation"
? "border-[#3f9e6a]/55 bg-[#3f9e6a]/16 text-[#aef0c6]" ? "border-[#3f9e6a]/55 bg-[#3f9e6a]/16 text-[#aef0c6]"
@@ -716,7 +720,9 @@ export default function MapPage() {
<Undo2 size={14} /> <Undo2 size={14} />
</span> </span>
<span className="text-[10px] text-[#8f8066]"> <span className="text-[10px] text-[#8f8066]">
{routes.filter((r) => r.type === "repatriation").length} {activeRoute?.type === "repatriation"
? "退出"
: `${routes.filter((r) => r.type === "repatriation").length}`}
</span> </span>
</button> </button>
<button <button