Commit f100852d authored by Chunchi Che's avatar Chunchi Che

add Side.tsx

parent 6c492c78
Pipeline #23175 passed with stages
in 11 minutes and 53 seconds
...@@ -147,7 +147,7 @@ export const Component: React.FC = () => { ...@@ -147,7 +147,7 @@ export const Component: React.FC = () => {
Component.displayName = "Build"; Component.displayName = "Build";
/** 正在编辑的卡组 */ /** 正在编辑的卡组 */
const DeckEditor: React.FC<{ export const DeckEditor: React.FC<{
deck: IDeck; deck: IDeck;
onClear: () => void; onClear: () => void;
onReset: () => void; onReset: () => void;
......
...@@ -28,6 +28,10 @@ const router = createBrowserRouter([ ...@@ -28,6 +28,10 @@ const router = createBrowserRouter([
path: "/duel", path: "/duel",
lazy: () => import("./Duel/Main"), lazy: () => import("./Duel/Main"),
}, },
{
path: "/side",
lazy: () => import("./Side"),
},
], ],
}, },
]); ]);
......
import { App, Button, Modal } from "antd";
import React from "react";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import { deckStore } from "@/stores";
import { DeckEditor } from "../BuildDeck";
import { editDeckStore } from "../BuildDeck/store";
import { iDeckToEditingDeck } from "../BuildDeck/utils";
import { Background } from "../Shared";
export const Component: React.FC = () => {
const deck = deckStore.decks[0];
const { message } = App.useApp();
return (
<Modal
title="请选择更换副卡组"
open={true}
width={700}
footer={<Button onClick={() => {}}>副卡组更换完毕</Button>}
>
<DndProvider backend={HTML5Backend}>
<Background />
<DeckEditor
deck={deck}
onClear={() => message.info("对局中清空卡组不怕找不回来吗?!")}
onSave={() => message.info("点击右下角按钮确认副卡组更换完毕")}
onReset={async () => {
editDeckStore.set(await iDeckToEditingDeck(deck));
}}
/>
</DndProvider>
</Modal>
);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment