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
41a297be
Commit
41a297be
authored
Jul 03, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Timer Component
parent
fd10aa4d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
1 deletion
+34
-1
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+2
-1
src/ui/Duel/PlayMat/Timer/index.scss
src/ui/Duel/PlayMat/Timer/index.scss
+0
-0
src/ui/Duel/PlayMat/Timer/index.tsx
src/ui/Duel/PlayMat/Timer/index.tsx
+31
-0
src/ui/Duel/PlayMat/index.ts
src/ui/Duel/PlayMat/index.ts
+1
-0
No files found.
src/ui/Duel/Main.tsx
View file @
41a297be
...
...
@@ -14,7 +14,7 @@ import {
SortCardModal
,
YesNoModal
,
}
from
"
./Message
"
;
import
{
LifeBar
,
Mat
,
Menu
}
from
"
./PlayMat
"
;
import
{
LifeBar
,
Mat
,
Menu
,
Timer
}
from
"
./PlayMat
"
;
const
NeosDuel
=
()
=>
{
return
(
...
...
@@ -24,6 +24,7 @@ const NeosDuel = () => {
<
Menu
/>
<
LifeBar
/>
<
Mat
/>
<
Timer
/>
<
CardModal
/>
<
CardListModal
/>
<
HintNotification
/>
...
...
src/ui/Duel/PlayMat/Timer/index.scss
0 → 100644
View file @
41a297be
src/ui/Duel/PlayMat/Timer/index.tsx
0 → 100644
View file @
41a297be
import
"
./index.scss
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
AnimatedNumbers
from
"
react-animated-numbers
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
matStore
}
from
"
@/stores
"
;
export
const
Timer
:
React
.
FC
=
()
=>
{
const
[
time
,
setTime
]
=
useState
(
0
);
const
snap
=
useSnapshot
(
matStore
);
useEffect
(()
=>
{
const
interval
=
setInterval
(()
=>
{
if
(
time
>
0
)
{
setTime
((
time
)
=>
time
-
1
);
}
},
1000
);
return
()
=>
clearInterval
(
interval
);
},
[]);
useEffect
(()
=>
{
setTime
(
snap
.
timeLimits
.
me
);
},
[
snap
.
timeLimits
.
me
]);
useEffect
(()
=>
{
setTime
(
snap
.
timeLimits
.
op
);
},
[
snap
.
timeLimits
.
op
]);
return
<
div
>
{
<
AnimatedNumbers
animateToNumber=
{
time
}
/>
}
</
div
>;
};
src/ui/Duel/PlayMat/index.ts
View file @
41a297be
export
*
from
"
./LifeBar
"
;
export
*
from
"
./Mat
"
;
export
*
from
"
./Menu
"
;
export
*
from
"
./Timer
"
;
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