Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9976f58

Browse files
committed
hot key to continue (ctrl + enter)
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent11fbb68 commit9976f58

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

‎web-app/src/containers/Tutorial/components/Continue.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import*asReactfrom'react'
2-
import{Dialog}from'@alifd/next'
2+
import{Dialog,Icon}from'@alifd/next'
33
import{css,jsx}from'@emotion/core'
44
importButtonfrom'../../../components/Button'
55
importProgressPiefrom'./ProgressPie'
@@ -14,6 +14,9 @@ const styles = {
1414
message:{
1515
textAlign:'center'as'center',
1616
},
17+
buttonSubtext:{
18+
padding:'0.5rem',
19+
},
1720
}
1821

1922
interfaceProps{
@@ -58,8 +61,10 @@ const Continue = (props: Props) => {
5861
<h3>{props.title}</h3>
5962
<br/>
6063
<Buttontype="primary"size="large"onClick={onContinue}>
61-
Continue
64+
Continue&nbsp;&nbsp;
65+
<Icontype="arrow-right"/>
6266
</Button>
67+
<divcss={styles.buttonSubtext}>(ctrl + enter)</div>
6368
</div>
6469
</div>
6570
</Dialog>

‎web-app/src/containers/Tutorial/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ const TutorialPage = (props: PageProps) => {
8585
constonContinue=():void=>{
8686
props.send({
8787
type:'NEXT_LEVEL',
88-
payload:{
89-
levelId:position.levelId,
90-
},
9188
})
9289
}
9390

‎web-app/src/services/state/actions/context.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ const contextActions: ActionFunctionMap<T.MachineContext, T.MachineEvent> = {
118118
returnevent.payload
119119
},
120120
}),
121+
//@ts-ignore
122+
updateLevel:assign({
123+
position:(context:T.MachineContext,event:T.MachineEvent):any=>{
124+
constlevelId=context.position.levelId
125+
return{ levelId}
126+
},
127+
}),
121128
loadNext:send(
122129
(context:T.MachineContext):T.Action=>{
123130
const{ position, progress}=context

‎web-app/src/services/state/machine.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ export const createMachine = (options: any) => {
220220
on:{
221221
NEXT_LEVEL:{
222222
target:'LoadNext',
223-
actions:['testClear','updatePosition'],
223+
actions:['testClear','updateLevel'],
224+
},
225+
KEY_PRESS_ENTER:{
226+
target:'LoadNext',
227+
actions:['testClear','updateLevel'],
224228
},
225229
},
226230
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp