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
bd0a6c1b
Commit
bd0a6c1b
authored
Dec 24, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add HintNotification component
parent
a4c32592
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
src/reducers/duel/hint.ts
src/reducers/duel/hint.ts
+2
-2
src/ui/Duel/simpleDuel/hintNotification.tsx
src/ui/Duel/simpleDuel/hintNotification.tsx
+32
-0
No files found.
src/reducers/duel/hint.ts
View file @
bd0a6c1b
...
@@ -44,5 +44,5 @@ export const hintCase = (builder: ActionReducerMapBuilder<DuelState>) => {
...
@@ -44,5 +44,5 @@ export const hintCase = (builder: ActionReducerMapBuilder<DuelState>) => {
});
});
};
};
export
const
selectMeHint
=
(
state
:
RootState
)
=>
state
.
duel
.
meHint
||
""
;
export
const
selectMeHint
=
(
state
:
RootState
)
=>
state
.
duel
.
meHint
;
export
const
selectOpHint
=
(
state
:
RootState
)
=>
state
.
duel
.
opHint
||
""
;
export
const
selectOpHint
=
(
state
:
RootState
)
=>
state
.
duel
.
opHint
;
src/ui/Duel/simpleDuel/hintNotification.tsx
0 → 100644
View file @
bd0a6c1b
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
useAppSelector
}
from
"
../../../hook
"
;
import
{
selectMeHint
,
selectOpHint
}
from
"
../../../reducers/duel/hint
"
;
import
{
notification
}
from
"
antd
"
;
const
HintNotification
=
()
=>
{
const
meHint
=
useAppSelector
(
selectMeHint
);
const
opHint
=
useAppSelector
(
selectOpHint
);
const
[
api
,
contextHolder
]
=
notification
.
useNotification
();
useEffect
(()
=>
{
if
(
meHint
&&
meHint
.
msg
)
{
api
.
info
({
message
:
`<我方>
${
meHint
.
msg
}
`
,
placement
:
"
bottom
"
,
});
}
},
[
meHint
]);
useEffect
(()
=>
{
if
(
opHint
&&
opHint
.
msg
)
{
api
.
info
({
message
:
`<对方>
${
opHint
.
msg
}
`
,
placement
:
"
top
"
,
});
}
},
[
opHint
]);
return
<>
{
contextHolder
}
</>;
};
export
default
HintNotification
;
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