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
79c08127
Commit
79c08127
authored
Feb 19, 2023
by
Chunchi Che
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "add LazyLoad component"
This reverts commit
fdd1ae1f
.
parent
fdd1ae1f
Pipeline
#20268
passed with stages
in 4 minutes
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
20 deletions
+30
-20
src/ui/LazyLoad.tsx
src/ui/LazyLoad.tsx
+0
-8
src/ui/Neos.tsx
src/ui/Neos.tsx
+30
-12
No files found.
src/ui/LazyLoad.tsx
deleted
100644 → 0
View file @
fdd1ae1f
import
React
,
{
Suspense
}
from
"
react
"
;
const
LazyLoad
=
(
props
:
{
lazy
:
React
.
ReactNode
})
=>
{
return
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
>
{
props
.
lazy
}
</
Suspense
>;
};
export
const
lazyImport
=
(
module
:
string
)
=>
React
.
lazy
(()
=>
import
(
module
));
export
default
LazyLoad
;
src/ui/Neos.tsx
View file @
79c08127
import
React
from
"
react
"
;
import
React
,
{
Suspense
}
from
"
react
"
;
import
{
Routes
,
Route
}
from
"
react-router-dom
"
;
import
LazyLoad
,
{
lazyImport
}
from
"
./LazyLoad
"
;
const
Login
=
lazyImport
(
"
./Login
"
);
const
WaitRoom
=
lazyImport
(
"
./WaitRoom
"
);
const
Mora
=
lazyImport
(
"
./Mora
"
);
const
NeosDuel
=
lazyImport
(
"
./Duel/main
"
);
const
Login
=
React
.
lazy
(()
=>
import
(
"
./Login
"
)
);
const
WaitRoom
=
React
.
lazy
(()
=>
import
(
"
./WaitRoom
"
)
);
const
Mora
=
React
.
lazy
(()
=>
import
(
"
./Mora
"
)
);
const
NeosDuel
=
React
.
lazy
(()
=>
import
(
"
./Duel/main
"
)
);
export
default
function
()
{
// FIXME: 这里Mora/Duel路由应该由每个房间指定一个路径
return
(
<
Routes
>
<
Route
path=
"/"
element=
{
<
LazyLoad
lazy=
{
<
Login
/>
}
/>
}
/>
<
Route
path=
"/"
element=
{
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
>
<
Login
/>
</
Suspense
>
}
/>
<
Route
path=
"/room/:player/:passWd/:ip"
element=
{
<
LazyLoad
lazy=
{
<
WaitRoom
/>
}
/>
}
element=
{
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
>
<
WaitRoom
/>
</
Suspense
>
}
/>
<
Route
path=
"/mora/:player/:passWd/:ip"
element=
{
<
LazyLoad
lazy=
{
<
Mora
/>
}
/>
}
path=
"/room/:player/:passWd/:ip"
element=
{
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
>
<
Mora
/>
</
Suspense
>
}
/>
<
Route
path=
"/duel/:player/:passWd/:ip"
element=
{
<
LazyLoad
lazy=
{
<
NeosDuel
/>
}
/>
}
path=
"/room/:player/:passWd/:ip"
element=
{
<
Suspense
fallback=
{
<
div
>
Loading...
</
div
>
}
>
<
NeosDuel
/>
</
Suspense
>
}
/>
</
Routes
>
);
...
...
Chunchi Che
@SKTT1Ryze
mentioned in commit
0ba53828
·
Feb 19, 2023
mentioned in commit
0ba53828
mentioned in commit 0ba53828ad83ea9bdaec32c145be2711be08a3ee
Toggle commit list
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