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
632dbdbb
Commit
632dbdbb
authored
Jul 14, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add the EndModal component
parent
cc3c8084
Pipeline
#22687
passed with stages
in 12 minutes and 25 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
src/ui/Duel/Message/EndModal/index.scss
src/ui/Duel/Message/EndModal/index.scss
+0
-0
src/ui/Duel/Message/EndModal/index.tsx
src/ui/Duel/Message/EndModal/index.tsx
+62
-0
src/ui/Duel/Message/index.ts
src/ui/Duel/Message/index.ts
+1
-0
No files found.
src/ui/Duel/Message/EndModal/index.scss
0 → 100644
View file @
632dbdbb
src/ui/Duel/Message/EndModal/index.tsx
0 → 100644
View file @
632dbdbb
import
"
./index.scss
"
;
import
React
from
"
react
"
;
import
{
proxy
,
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
}
from
"
@/api
"
;
import
{
replayStore
}
from
"
@/stores
"
;
import
{
NeosModal
}
from
"
../NeosModal
"
;
interface
EndProps
{
isOpen
:
boolean
;
isWin
:
boolean
;
reason
?:
string
;
}
const
defaultProps
:
EndProps
=
{
isOpen
:
false
,
isWin
:
false
,
};
const
localStore
=
proxy
(
defaultProps
);
export
const
EndModal
:
React
.
FC
=
()
=>
{
const
{
isOpen
,
isWin
,
reason
}
=
useSnapshot
(
localStore
);
return
(
<
NeosModal
title=
{
fetchStrings
(
"
!system
"
,
1500
)
}
open=
{
isOpen
}
onOk=
{
()
=>
{
const
replayBuffers
=
replayStore
.
encode
();
const
blob
=
new
Blob
(
replayBuffers
,
{
type
:
"
application/octet-stream
"
,
});
// download the replay file
window
.
open
(
URL
.
createObjectURL
(
blob
));
rs
();
}
}
onCancel=
{
()
=>
{
// TODO: reset all stores, and navigate to home
rs
();
}
}
>
<
p
>
{
isWin
?
"
Win
"
:
"
Defeated
"
}
</
p
>
<
p
>
{
reason
}
</
p
>
<
p
>
{
fetchStrings
(
"
!system
"
,
1340
)
}
</
p
>
</
NeosModal
>
);
};
let
rs
:
(
arg
?:
any
)
=>
void
=
()
=>
{};
export
const
displayEndModal
=
async
(
isWin
:
boolean
,
reason
?:
string
)
=>
{
localStore
.
isWin
=
isWin
;
localStore
.
reason
=
reason
;
localStore
.
isOpen
=
true
;
await
new
Promise
<
void
>
((
resolve
)
=>
(
rs
=
resolve
));
// 等待在组件内resolve
localStore
.
isOpen
=
false
;
localStore
.
isWin
=
false
;
localStore
.
reason
=
undefined
;
};
src/ui/Duel/Message/index.ts
View file @
632dbdbb
...
...
@@ -3,6 +3,7 @@ export * from "./AnnounceModal";
export
*
from
"
./CardListModal
"
;
export
*
from
"
./CardModal
"
;
export
*
from
"
./CheckCounterModal
"
;
export
*
from
"
./EndModal
"
;
export
*
from
"
./HintNotification
"
;
export
*
from
"
./OptionModal
"
;
export
*
from
"
./PositionModal
"
;
...
...
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