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
7b4082b8
Commit
7b4082b8
authored
Apr 28, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add AnnounceModal
parent
b9f6bee4
Pipeline
#26757
failed with stages
in 9 minutes and 17 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
0 deletions
+100
-0
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+2
-0
src/ui/Duel/Message/AnnounceModal/index.module.scss
src/ui/Duel/Message/AnnounceModal/index.module.scss
+12
-0
src/ui/Duel/Message/AnnounceModal/index.tsx
src/ui/Duel/Message/AnnounceModal/index.tsx
+85
-0
src/ui/Shared/YgoCard/index.tsx
src/ui/Shared/YgoCard/index.tsx
+1
-0
No files found.
src/ui/Duel/Main.tsx
View file @
7b4082b8
...
@@ -18,6 +18,7 @@ import {
...
@@ -18,6 +18,7 @@ import {
SortCardModal
,
SortCardModal
,
YesNoModal
,
YesNoModal
,
}
from
"
./Message
"
;
}
from
"
./Message
"
;
import
{
AnnounceModal
}
from
"
./Message/AnnounceModal
"
;
import
{
LifeBar
,
Mat
,
Menu
,
Underlying
}
from
"
./PlayMat
"
;
import
{
LifeBar
,
Mat
,
Menu
,
Underlying
}
from
"
./PlayMat
"
;
import
{
ChatBox
}
from
"
./PlayMat/ChatBox
"
;
import
{
ChatBox
}
from
"
./PlayMat/ChatBox
"
;
import
{
HandChain
}
from
"
./PlayMat/HandChain
"
;
import
{
HandChain
}
from
"
./PlayMat/HandChain
"
;
...
@@ -58,6 +59,7 @@ export const Component: React.FC = () => {
...
@@ -58,6 +59,7 @@ export const Component: React.FC = () => {
<
CheckCounterModal
/>
<
CheckCounterModal
/>
<
SortCardModal
/>
<
SortCardModal
/>
<
SimpleSelectCardsModal
/>
<
SimpleSelectCardsModal
/>
<
AnnounceModal
/>
<
EndModal
/>
<
EndModal
/>
<
ChatBox
/>
<
ChatBox
/>
<
HandChain
/>
<
HandChain
/>
...
...
src/ui/Duel/Message/AnnounceModal/index.module.scss
0 → 100644
View file @
7b4082b8
.container
{
display
:
flex
;
flex-direction
:
column
;
.input
{
display
:
flex
;
}
.list
{
}
}
src/ui/Duel/Message/AnnounceModal/index.tsx
0 → 100644
View file @
7b4082b8
import
{
SearchOutlined
}
from
"
@ant-design/icons
"
;
import
{
Avatar
,
Button
,
Input
,
List
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
proxy
,
useSnapshot
}
from
"
valtio
"
;
import
{
CardMeta
,
sendSelectOptionResponse
}
from
"
@/api
"
;
import
{
getCardImgUrl
}
from
"
@/ui/Shared
"
;
import
{
NeosModal
}
from
"
../NeosModal
"
;
import
styles
from
"
./index.module.scss
"
;
interface
Props
{
isOpen
:
boolean
;
opcodes
:
number
[];
}
const
defaultProps
=
{
isOpen
:
false
,
opcodes
:
[],
};
const
store
=
proxy
<
Props
>
(
defaultProps
);
export
const
AnnounceModal
:
React
.
FC
=
()
=>
{
const
{
isOpen
}
=
useSnapshot
(
store
);
const
[
searchWord
,
setSearchWord
]
=
useState
(
""
);
const
[
cardList
,
setCardList
]
=
useState
<
CardMeta
[]
>
([]);
const
[
selected
,
setSelected
]
=
useState
<
number
|
undefined
>
(
undefined
);
const
handleSearch
=
()
=>
{};
const
onSummit
=
()
=>
{
if
(
selected
!==
undefined
)
{
sendSelectOptionResponse
(
selected
);
rs
();
setSearchWord
(
""
);
setCardList
([]);
}
};
return
(
<
NeosModal
title=
"请输入关键字并选择宣言的卡"
open=
{
isOpen
}
footer=
{
<
Button
disabled=
{
selected
===
undefined
}
onClick=
{
onSummit
}
>
确定
</
Button
>
}
>
<
div
className=
{
styles
.
container
}
>
<
Input
className=
{
styles
.
input
}
placeholder=
"请输入宣言卡名(或关键字)"
bordered=
{
false
}
value=
{
searchWord
}
onChange=
{
(
e
)
=>
setSearchWord
(
e
.
target
.
value
)
}
suffix=
{
<
Button
type=
"text"
icon=
{
<
SearchOutlined
/>
}
onClick=
{
()
=>
handleSearch
()
}
/>
}
onKeyUp=
{
(
e
)
=>
e
.
key
===
"
Enter
"
&&
handleSearch
()
}
allowClear
/>
<
List
pagination=
{
{
position
:
"
bottom
"
,
align
:
"
center
"
}
}
dataSource=
{
cardList
}
renderItem=
{
(
item
,
index
)
=>
(
<
List
.
Item
key=
{
index
}
>
<
List
.
Item
.
Meta
avatar=
{
<
Avatar
src=
{
getCardImgUrl
(
item
.
id
)
}
/>
}
title=
{
<
a
>
{
item
.
text
.
name
}
</
a
>
}
description=
{
item
.
text
.
desc
}
/>
</
List
.
Item
>
)
}
/>
</
div
>
</
NeosModal
>
);
};
let
rs
:
(
v
?:
any
)
=>
void
=
()
=>
{};
src/ui/Shared/YgoCard/index.tsx
View file @
7b4082b8
...
@@ -53,6 +53,7 @@ export const YgoCard: React.FC<Props> = (props) => {
...
@@ -53,6 +53,7 @@ export const YgoCard: React.FC<Props> = (props) => {
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
// TODO: 这个函数应该从这个文件抽离出来作为公共的函数使用
export
function
getCardImgUrl
(
code
:
number
,
back
=
false
)
{
export
function
getCardImgUrl
(
code
:
number
,
back
=
false
)
{
const
ASSETS_BASE
=
const
ASSETS_BASE
=
import
.
meta
.
env
.
BASE_URL
===
"
/
"
import
.
meta
.
env
.
BASE_URL
===
"
/
"
...
...
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