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
c81ab240
Commit
c81ab240
authored
Aug 09, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: small
parent
f9cbd39d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
src/ui/WaitRoom/index.tsx
src/ui/WaitRoom/index.tsx
+15
-14
No files found.
src/ui/WaitRoom/index.tsx
View file @
c81ab240
...
@@ -64,9 +64,10 @@ export const Component: React.FC = () => {
...
@@ -64,9 +64,10 @@ export const Component: React.FC = () => {
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
room
.
stage
==
RoomStage
.
DUEL_START
)
{
if
(
room
.
stage
==
=
RoomStage
.
DUEL_START
)
{
// 决斗开始,跳转决斗页面
// 决斗开始,跳转决斗页面
navigate
(
"
/duel
"
);
navigate
(
"
/duel
"
);
// TODO: 重置房间状态(也可能是在这个页面的loader之中重置,就看是进房间重置还是离开时重置,可能需要考虑意外离开的情况)
}
}
},
[
room
.
stage
]);
},
[
room
.
stage
]);
...
@@ -104,7 +105,7 @@ export const Component: React.FC = () => {
...
@@ -104,7 +105,7 @@ export const Component: React.FC = () => {
player=
{
me
}
player=
{
me
}
avatar=
{
user
?.
avatar_url
}
avatar=
{
user
?.
avatar_url
}
btn=
{
btn=
{
room
.
stage
==
RoomStage
.
WAITING
?
(
room
.
stage
==
=
RoomStage
.
WAITING
?
(
<
Button
<
Button
size=
"large"
size=
"large"
className=
{
styles
[
"
btn-join
"
]
}
className=
{
styles
[
"
btn-join
"
]
}
...
@@ -155,7 +156,7 @@ export const Component: React.FC = () => {
...
@@ -155,7 +156,7 @@ export const Component: React.FC = () => {
roomStore
.
stage
=
RoomStage
.
HAND_SELECTED
;
roomStore
.
stage
=
RoomStage
.
HAND_SELECTED
;
}
}
}
}
onTpSelect=
{
(
tp
)
=>
{
onTpSelect=
{
(
tp
)
=>
{
sendTpResult
(
tp
==
Tp
.
First
);
sendTpResult
(
tp
==
=
Tp
.
First
);
roomStore
.
stage
=
RoomStage
.
TP_SELECTED
;
roomStore
.
stage
=
RoomStage
.
TP_SELECTED
;
}
}
}
}
/>
/>
...
@@ -186,7 +187,7 @@ const PlayerZone: React.FC<{
...
@@ -186,7 +187,7 @@ const PlayerZone: React.FC<{
src=
{
src=
{
avatar
&&
player
avatar
&&
player
?
avatar
?
avatar
:
player
&&
player
.
state
!=
PlayerState
.
LEAVE
:
player
&&
player
.
state
!=
=
PlayerState
.
LEAVE
?
`${NeosConfig.assetsPath}/default-avatar.png`
?
`${NeosConfig.assetsPath}/default-avatar.png`
:
""
:
""
}
}
...
@@ -197,7 +198,7 @@ const PlayerZone: React.FC<{
...
@@ -197,7 +198,7 @@ const PlayerZone: React.FC<{
)
}
)
}
</
div
>
</
div
>
<
div
className=
{
styles
.
name
}
>
<
div
className=
{
styles
.
name
}
>
{
player
&&
player
.
state
!=
PlayerState
.
LEAVE
?
(
{
player
&&
player
.
state
!=
=
PlayerState
.
LEAVE
?
(
player
.
name
player
.
name
)
:
(
)
:
(
<
Skeleton
.
Input
size=
"small"
/>
<
Skeleton
.
Input
size=
"small"
/>
...
@@ -248,14 +249,14 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({
...
@@ -248,14 +249,14 @@ const Controller: React.FC<{ onDeckChange: (deckName: string) => void }> = ({
size=
"large"
size=
"large"
icon=
{
<
IconFont
type=
"icon-record"
size=
{
18
}
/>
}
icon=
{
<
IconFont
type=
"icon-record"
size=
{
18
}
/>
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
if
(
snapRoom
.
selfType
!=
SelfType
.
OBSERVER
)
{
if
(
snapRoom
.
selfType
!=
=
SelfType
.
OBSERVER
)
{
sendHsToObserver
();
sendHsToObserver
();
}
else
{
}
else
{
sendHsToDuelList
();
sendHsToDuelList
();
}
}
}
}
}
}
>
>
{
snapRoom
.
selfType
==
SelfType
.
OBSERVER
?
"
加入决斗者
"
:
"
加入观战
"
}
{
snapRoom
.
selfType
==
=
SelfType
.
OBSERVER
?
"
加入决斗者
"
:
"
加入观战
"
}
<
Avatar
.
Group
className=
{
styles
[
"
avatars-watch
"
]
}
>
<
Avatar
.
Group
className=
{
styles
[
"
avatars-watch
"
]
}
>
{
Array
.
from
({
length
:
snapRoom
.
observerCount
}).
map
((
_
,
idx
)
=>
(
{
Array
.
from
({
length
:
snapRoom
.
observerCount
}).
map
((
_
,
idx
)
=>
(
<
Avatar
<
Avatar
...
@@ -320,34 +321,34 @@ const ActionButton: React.FC<{
...
@@ -320,34 +321,34 @@ const ActionButton: React.FC<{
<
SpecialButton
<
SpecialButton
className=
{
styles
[
"
btns-action
"
]
}
className=
{
styles
[
"
btns-action
"
]
}
disabled=
{
disabled=
{
stage
!=
RoomStage
.
WAITING
||
stage
!=
=
RoomStage
.
WAITING
||
(
stage
==
RoomStage
.
WAITING
&&
!
isHost
)
(
stage
==
=
RoomStage
.
WAITING
&&
!
isHost
)
}
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
sendHsStart
();
sendHsStart
();
}
}
}
}
>
>
{
stage
==
RoomStage
.
WAITING
?
(
{
stage
==
=
RoomStage
.
WAITING
?
(
<>
<>
<
IconFont
type=
"icon-play"
size=
{
12
}
/>
<
IconFont
type=
"icon-play"
size=
{
12
}
/>
开始游戏
开始游戏
</>
</>
)
:
stage
==
RoomStage
.
HAND_SELECTING
?
(
)
:
stage
==
=
RoomStage
.
HAND_SELECTING
?
(
<>
<>
<
IconFont
type=
"icon-mora"
size=
{
20
}
/>
<
IconFont
type=
"icon-mora"
size=
{
20
}
/>
<
span
>
请猜拳
</
span
>
<
span
>
请猜拳
</
span
>
</>
</>
)
:
stage
==
RoomStage
.
HAND_SELECTED
?
(
)
:
stage
==
=
RoomStage
.
HAND_SELECTED
?
(
<>
<>
<
LoadingOutlined
/>
<
LoadingOutlined
/>
<
span
>
等待对方猜拳
</
span
>
<
span
>
等待对方猜拳
</
span
>
</>
</>
)
:
stage
==
RoomStage
.
TP_SELECTING
?
(
)
:
stage
==
=
RoomStage
.
TP_SELECTING
?
(
<>
<>
<
IconFont
type=
"icon-one"
size=
{
18
}
/>
<
IconFont
type=
"icon-one"
size=
{
18
}
/>
<
span
>
请选择先后手
</
span
>
<
span
>
请选择先后手
</
span
>
</>
</>
)
:
stage
==
RoomStage
.
TP_SELECTED
?
(
)
:
stage
==
=
RoomStage
.
TP_SELECTED
?
(
<>
<>
<
LoadingOutlined
/>
<
LoadingOutlined
/>
<
span
>
等待游戏开始
</
span
>
<
span
>
等待游戏开始
</
span
>
...
...
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