fix(map): 国宝海外回归按钮支持退出激活的回归路线
激活回归路线后再次点击该按钮可直接退出,不再反复弹出文物选择框; 按钮文案在「N 件 / 退出」间切换。
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user