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
3b8bd89f
Commit
3b8bd89f
authored
Jun 10, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove popover
parent
265ece97
Pipeline
#27620
passed with stages
in 8 minutes and 25 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
41 deletions
+13
-41
src/ui/BuildDeck/DeckDatabase/DeckResults/index.tsx
src/ui/BuildDeck/DeckDatabase/DeckResults/index.tsx
+13
-41
No files found.
src/ui/BuildDeck/DeckDatabase/DeckResults/index.tsx
View file @
3b8bd89f
import
{
CopyOutlined
}
from
"
@ant-design/icons
"
;
import
{
Button
,
message
,
Pagination
,
Popover
}
from
"
antd
"
;
import
{
message
,
Pagination
}
from
"
antd
"
;
import
React
,
{
memo
,
useEffect
}
from
"
react
"
;
import
{
type
INTERNAL_Snapshot
as
Snapshot
,
proxy
,
useSnapshot
}
from
"
valtio
"
;
import
YGOProDeck
from
"
ygopro-deck-encode
"
;
...
...
@@ -7,7 +6,6 @@ import YGOProDeck from "ygopro-deck-encode";
import
{
pullDecks
}
from
"
@/api
"
;
import
{
MdproDeck
}
from
"
@/api/mdproDeck/schema
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
deckStore
}
from
"
@/stores
"
;
import
{
IconFont
}
from
"
@/ui/Shared
"
;
import
{
setSelectedDeck
}
from
"
../..
"
;
...
...
@@ -105,18 +103,6 @@ export const DeckResults: React.FC = memo(() => {
});
const
MdproDeckBlock
:
React
.
FC
<
Snapshot
<
MdproDeck
>>
=
(
deck
)
=>
(
<
Popover
placement=
"topRight"
content=
{
<
Button
className=
{
styles
[
"
copy-btn
"
]
}
icon=
{
<
CopyOutlined
/>
}
onClick=
{
()
=>
copyMdproDeckToLocal
(
deck
)
}
>
复制
</
Button
>
}
>
<
div
className=
{
styles
[
"
mdpro-deck
"
]
}
onClick=
{
async
()
=>
await
copyMdproDeckToEditing
(
deck
)
}
...
...
@@ -131,22 +117,8 @@ const MdproDeckBlock: React.FC<Snapshot<MdproDeck>> = (deck) => (
<
div
>
{
`By ${truncateString(deck.deckContributor, 6)}`
}
</
div
>
</
div
>
</
div
>
</
Popover
>
);
const
copyMdproDeckToLocal
=
async
(
mdproDeck
:
MdproDeck
)
=>
{
const
deck
=
YGOProDeck
.
fromYdkString
(
mdproDeck
.
deckYdk
);
if
(
!
(
deck
.
main
.
length
+
deck
.
extra
.
length
+
deck
.
side
.
length
===
0
))
{
const
deckName
=
mdproDeck
.
deckName
;
const
result
=
await
deckStore
.
add
({
deckName
,
...
deck
});
if
(
result
)
{
message
.
success
(
"
卡组复制成功!
"
);
}
}
else
{
message
.
error
(
"
卡组解析失败,请联系技术人员解决:<ccc@neos.moe>
"
);
}
};
const
copyMdproDeckToEditing
=
async
(
mdproDeck
:
MdproDeck
)
=>
{
const
deck
=
YGOProDeck
.
fromYdkString
(
mdproDeck
.
deckYdk
);
...
...
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