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
7f602b1c
Commit
7f602b1c
authored
Jul 28, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle matchAI
parent
91ea1bf9
Pipeline
#22819
passed with stages
in 14 minutes and 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
src/ui/Home/index.tsx
src/ui/Home/index.tsx
+11
-2
No files found.
src/ui/Home/index.tsx
View file @
7f602b1c
...
...
@@ -8,12 +8,21 @@ import { accountStore } from "@/stores";
import
styles
from
"
./index.module.scss
"
;
const
NeosConfig
=
useConfig
();
const
DefaultUserName
=
"
Guest
"
;
const
Home
:
React
.
FC
=
()
=>
{
const
{
user
}
=
useSnapshot
(
accountStore
);
const
navigate
=
useNavigate
();
const
onLogout
=
()
=>
{};
// TODO
const
onMatchAI
=
()
=>
{
const
username
=
user
?.
username
??
DefaultUserName
;
navigate
(
`/room/
${
username
}
/
${
encodeURIComponent
(
"
AI
"
)}
/
${
NeosConfig
.
servers
[
0
].
ip
}
:
${
NeosConfig
.
servers
[
0
].
port
}
`
);
};
useEffect
(()
=>
{
if
(
!
user
)
{
...
...
@@ -57,8 +66,8 @@ const Home: React.FC = () => {
<
button
>
娱乐匹配
</
button
>
<
button
>
竞技匹配
</
button
>
<
button
onClick=
{
()
=>
navigate
(
"
/match
"
)
}
>
自定义匹配
</
button
>
<
button
>
人机对战
</
button
>
<
button
>
录像回放
</
button
>
<
button
onClick=
{
onMatchAI
}
>
人机对战
</
button
>
<
button
onClick=
{
()
=>
navigate
(
"
/replay
"
)
}
>
录像回放
</
button
>
<
button
>
卡组编辑
</
button
>
</
div
>
</
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