Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
2849c472
Commit
2849c472
authored
Aug 13, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle create new deck
parent
82fcc0a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
+38
-5
src/ui/BuildDeck/DeckSelect.tsx
src/ui/BuildDeck/DeckSelect.tsx
+38
-5
No files found.
src/ui/BuildDeck/DeckSelect.tsx
View file @
2849c472
...
@@ -5,7 +5,15 @@ import {
...
@@ -5,7 +5,15 @@ import {
PlusOutlined
,
PlusOutlined
,
UploadOutlined
,
UploadOutlined
,
}
from
"
@ant-design/icons
"
;
}
from
"
@ant-design/icons
"
;
import
{
App
,
Button
,
Dropdown
,
MenuProps
,
Upload
,
UploadProps
}
from
"
antd
"
;
import
{
App
,
Button
,
Dropdown
,
Input
,
MenuProps
,
Upload
,
UploadProps
,
}
from
"
antd
"
;
import
React
,
{
useRef
,
useState
}
from
"
react
"
;
import
React
,
{
useRef
,
useState
}
from
"
react
"
;
import
YGOProDeck
from
"
ygopro-deck-encode
"
;
import
YGOProDeck
from
"
ygopro-deck-encode
"
;
...
@@ -22,13 +30,38 @@ export const DeckSelect: React.FC<{
...
@@ -22,13 +30,38 @@ export const DeckSelect: React.FC<{
onAdd
:
()
=>
void
;
onAdd
:
()
=>
void
;
}
>
=
({
decks
,
selected
,
onSelect
,
onDelete
,
onDownload
,
onAdd
})
=>
{
}
>
=
({
decks
,
selected
,
onSelect
,
onDelete
,
onDownload
,
onAdd
})
=>
{
const
newDeck
=
useRef
<
IDeck
|
null
>
(
null
);
const
newDeck
=
useRef
<
IDeck
|
null
>
(
null
);
const
newDeckName
=
useRef
<
string
|
null
>
(
null
);
const
{
modal
}
=
App
.
useApp
();
const
{
modal
}
=
App
.
useApp
();
const
modalProps
=
{
width
:
500
,
centered
:
true
,
icon
:
null
};
const
showCreateModal
=
()
=>
{
const
{
destroy
}
=
modal
.
info
({
...
modalProps
,
title
:
"
请输入新卡组名称
"
,
content
:
(
<
Input
onChange=
{
(
e
)
=>
{
newDeckName
.
current
=
e
.
target
.
value
;
}
}
/>
),
okText
:
"
新建
"
,
onCancel
:
()
=>
destroy
(),
onOk
:
async
()
=>
{
if
(
newDeckName
.
current
&&
newDeckName
.
current
!==
""
)
{
await
deckStore
.
add
({
deckName
:
newDeckName
.
current
,
main
:
[],
extra
:
[],
side
:
[],
});
}
},
});
};
const
showUploadModal
=
()
=>
{
const
showUploadModal
=
()
=>
{
const
{
destroy
}
=
modal
.
info
({
const
{
destroy
}
=
modal
.
info
({
width
:
500
,
...
modalProps
,
centered
:
true
,
title
:
"
请上传YDK文件
"
,
title
:
"
请上传YDK文件
"
,
icon
:
null
,
content
:
(
content
:
(
<
DeckUploader
<
DeckUploader
onLoaded=
{
(
deck
)
=>
{
onLoaded=
{
(
deck
)
=>
{
...
@@ -51,7 +84,7 @@ export const DeckSelect: React.FC<{
...
@@ -51,7 +84,7 @@ export const DeckSelect: React.FC<{
key
:
"
1
"
,
key
:
"
1
"
,
label
:
"
新建卡组
"
,
label
:
"
新建卡组
"
,
icon
:
<
PlusOutlined
/>,
icon
:
<
PlusOutlined
/>,
onClick
:
()
=>
{}
,
onClick
:
showCreateModal
,
},
},
{
{
key
:
"
2
"
,
key
:
"
2
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment