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
80d19636
Commit
80d19636
authored
Aug 07, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some unused component
parent
466916de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
135 deletions
+0
-135
src/ui/LazyLoad.tsx
src/ui/LazyLoad.tsx
+0
-10
src/ui/Match.tsx
src/ui/Match.tsx
+0
-125
No files found.
src/ui/LazyLoad.tsx
deleted
100644 → 0
View file @
466916de
import
React
,
{
Suspense
}
from
"
react
"
;
// TODO: 这个组件不知道为啥某些路由用不了,后面研究下
const
LazyLoad
=
(
props
:
{
lazy
:
React
.
ReactNode
})
=>
{
return
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
>
{
props
.
lazy
}
</
Suspense
>;
};
export
const
Loading
=
()
=>
<
div
>
Loading
</
div
>;
export
default
LazyLoad
;
src/ui/Match.tsx
deleted
100644 → 0
View file @
466916de
/*
* 加入房间页面
*
* player: 玩家昵称;
* addr: IP地址;
* passWd: 房间密码。
*
* */
import
"
../styles/core.scss
"
;
import
{
Input
}
from
"
antd
"
;
import
Link
from
"
antd/es/typography/Link
"
;
import
React
,
{
ChangeEvent
,
useEffect
,
useState
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
useConfig
}
from
"
@/config
"
;
const
NeosConfig
=
useConfig
();
const
serverConfig
=
NeosConfig
.
servers
;
const
{
defaults
:
{
defaultPlayer
,
defaultPassword
},
automation
:
{
isAiMode
},
}
=
useConfig
();
export
default
function
Match
()
{
const
[
player
,
setPlayer
]
=
useState
(
defaultPlayer
);
const
[
passWd
,
setPasswd
]
=
useState
(
defaultPassword
);
const
[
ip
,
setIp
]
=
useState
(
`
${
serverConfig
[
0
].
ip
}
:
${
serverConfig
[
0
].
port
}
`
);
const
navigate
=
useNavigate
();
let
handlePlayerChange
=
(
event
:
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setPlayer
(
event
.
target
.
value
);
};
let
handlePasswdChange
=
(
event
:
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setPasswd
(
event
.
target
.
value
);
};
let
handleIpChange
=
(
event
:
ChangeEvent
<
HTMLInputElement
>
)
=>
{
setIp
(
event
.
target
.
value
);
};
// 因为萌卡服务器的房间密码会有`#`等特殊字符,因此这里用`encodeURIComponent`做下转义
const
handleSubmit
=
()
=>
navigate
(
`/room/
${
player
}
/
${
encodeURIComponent
(
passWd
)}
/
${
ip
}
`
);
useEffect
(()
=>
{
// 如果开启了AI模式,直接进入房间
if
(
isAiMode
)
{
handleSubmit
();
}
},
[]);
return
(
<
div
className=
"container"
>
<
div
id=
"login"
>
<
form
className=
"login-form"
onSubmit=
{
handleSubmit
}
>
<
span
className=
"fa fa-user"
></
span
>
<
Input
autoFocus
type=
"text"
placeholder=
"Player Name"
value=
{
player
}
onChange=
{
handlePlayerChange
}
required
/>
<
span
className=
"fa-solid fa-server"
></
span
>
<
Input
type=
"text"
placeholder=
"Server"
value=
{
ip
}
onChange=
{
handleIpChange
}
required
/>
<
span
className=
"fa fa-lock"
></
span
>
<
Input
type=
"password"
autoCorrect=
"off"
placeholder=
"Room Password"
value=
{
passWd
}
onChange=
{
handlePasswdChange
}
required
/>
<
Input
type=
"submit"
value=
"Enter Room"
/>
</
form
>
</
div
>
<
div
className=
"sign-up__actions clearfix"
>
<
p
>
Don't know how to play?
{
"
"
}
<
a
href=
"https://doc.neos.moe"
>
Player Guide
</
a
>
<
span
className=
"fa fa-arrow-right"
></
span
>
</
p
>
<
p
>
<
Link
href=
"replay"
>
Clik here to play ygo replay
</
Link
>
</
p
>
</
div
>
<
div
className=
"sign-in__actions clearfix"
>
<
ul
>
<
li
>
<
a
href=
"https://github.com/DarkNeos/neos-ts"
className=
"link link-github"
></
a
>
</
li
>
<
li
>
<
a
href=
"https://code.mycard.moe/mycard/Neos"
className=
"fa-brands fa-gitlab"
></
a
>
</
li
>
<
li
>
<
a
href=
"https://mycard.moe/"
>
<
img
src=
{
`${NeosConfig.assetsPath}/mycard.icon.png`
}
style=
{
{
width
:
"
25%
"
}
}
/>
</
a
>
</
li
>
<
li
>
<
a
className=
"fa-brands fa-discord"
></
a
>
</
li
>
</
ul
>
</
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