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
6ecae01f
Commit
6ecae01f
authored
Oct 01, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support search
parent
6d3d6113
Pipeline
#23646
passed with stages
in 14 minutes and 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
30 deletions
+39
-30
src/ui/Match/WatchContent.tsx
src/ui/Match/WatchContent.tsx
+39
-30
No files found.
src/ui/Match/WatchContent.tsx
View file @
6ecae01f
...
...
@@ -47,6 +47,7 @@ export const WatchContent: React.FC = () => {
const
[
rooms
,
setRooms
]
=
useState
<
Room
[]
>
([]);
const
{
message
}
=
App
.
useApp
();
const
{
watchID
}
=
useSnapshot
(
watchStore
);
const
[
query
,
setQuery
]
=
useState
(
""
);
// 暂时只支持竞技匹配的观战,TODO:后面需要加上娱乐匹配的支持
const
url
=
new
URL
(
athleticWatchUrl
);
url
.
searchParams
.
set
(
"
filter
"
,
"
started
"
);
...
...
@@ -103,46 +104,54 @@ export const WatchContent: React.FC = () => {
<
div
className=
{
styles
.
search
}
>
<
Input
className=
{
styles
.
input
}
placeholder=
"搜索房间"
placeholder=
"
通过玩家用户名
搜索房间"
bordered=
{
false
}
suffix=
{
<
Button
type=
"text"
icon=
{
<
SearchOutlined
/>
}
/>
}
value=
{
query
}
onChange=
{
(
e
)
=>
setQuery
(
e
.
target
.
value
)
}
/>
</
div
>
<
ScrollableArea
maxHeight=
"50vh"
>
{
readyState
===
ReadyState
.
CONNECTING
||
rooms
.
length
===
0
?
(
<
Empty
/>
)
:
(
rooms
.
map
((
room
)
=>
(
<
div
key=
{
room
.
id
}
>
<
div
className=
{
classNames
(
styles
.
item
,
{
[
styles
[
"
item-selected
"
]]:
watchID
&&
watchID
===
room
.
id
,
})
}
onClick=
{
()
=>
(
watchStore
.
watchID
=
room
.
id
)
}
>
<
div
className=
{
styles
.
avatar
}
>
<
Avatar
src=
{
avatarApi
.
replace
(
"
{username}
"
,
room
.
users
?.
at
(
0
)?.
username
??
"
?
"
,
)
}
/>
<
Avatar
src=
{
avatarApi
.
replace
(
"
{username}
"
,
room
.
users
?.
at
(
1
)?.
username
??
"
?
"
,
)
}
/>
rooms
.
filter
(
(
room
)
=>
room
.
users
?.
at
(
0
)?.
username
.
includes
(
query
)
||
room
.
users
?.
at
(
1
)?.
username
.
includes
(
query
),
)
.
map
((
room
)
=>
(
<
div
key=
{
room
.
id
}
>
<
div
className=
{
classNames
(
styles
.
item
,
{
[
styles
[
"
item-selected
"
]]:
watchID
&&
watchID
===
room
.
id
,
})
}
onClick=
{
()
=>
(
watchStore
.
watchID
=
room
.
id
)
}
>
<
div
className=
{
styles
.
avatar
}
>
<
Avatar
src=
{
avatarApi
.
replace
(
"
{username}
"
,
room
.
users
?.
at
(
0
)?.
username
??
"
?
"
,
)
}
/>
<
Avatar
src=
{
avatarApi
.
replace
(
"
{username}
"
,
room
.
users
?.
at
(
1
)?.
username
??
"
?
"
,
)
}
/>
</
div
>
<
div
className=
{
styles
.
title
}
>
{
`${room.users?.at(0)?.username} 与 ${room.users?.at(1)
?.username} 的决斗`
}
</
div
>
<
div
className=
{
styles
.
mode
}
>
竞技匹配
</
div
>
</
div
>
<
div
className=
{
styles
.
title
}
>
{
`${room.users?.at(0)?.username} 与 ${room.users?.at(1)
?.username} 的决斗`
}
</
div
>
<
div
className=
{
styles
.
mode
}
>
竞技匹配
</
div
>
<
Divider
className=
{
styles
.
divider
}
/>
</
div
>
<
Divider
className=
{
styles
.
divider
}
/>
</
div
>
))
))
)
}
</
ScrollableArea
>
</
div
>
...
...
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