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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
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
Pipeline
#23054
passed with stages
in 12 minutes and 53 seconds
Changes
1
Pipelines
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 {
PlusOutlined
,
UploadOutlined
,
}
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
YGOProDeck
from
"
ygopro-deck-encode
"
;
...
...
@@ -22,13 +30,38 @@ export const DeckSelect: React.FC<{
onAdd
:
()
=>
void
;
}
>
=
({
decks
,
selected
,
onSelect
,
onDelete
,
onDownload
,
onAdd
})
=>
{
const
newDeck
=
useRef
<
IDeck
|
null
>
(
null
);
const
newDeckName
=
useRef
<
string
|
null
>
(
null
);
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
{
destroy
}
=
modal
.
info
({
width
:
500
,
centered
:
true
,
...
modalProps
,
title
:
"
请上传YDK文件
"
,
icon
:
null
,
content
:
(
<
DeckUploader
onLoaded=
{
(
deck
)
=>
{
...
...
@@ -51,7 +84,7 @@ export const DeckSelect: React.FC<{
key
:
"
1
"
,
label
:
"
新建卡组
"
,
icon
:
<
PlusOutlined
/>,
onClick
:
()
=>
{}
,
onClick
:
showCreateModal
,
},
{
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