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

Commit84adae8

Browse files
committed
refactor web-app
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentac037f2 commit84adae8

File tree

9 files changed

+14
-17
lines changed

9 files changed

+14
-17
lines changed

‎typings/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ export interface MachineStateSchema {
6565
Setup:{
6666
states:{
6767
Startup:{}
68-
Start:{}
6968
ValidateSetup:{}
69+
Start:{}
7070
SelectTutorial:{}
7171
SetupNewTutorial:{}
72-
StartNewTutorial:{}
72+
StartTutorial:{}
7373
}
7474
}
7575
Tutorial:{

‎web-app/src/Routes.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import LoadingPage from './containers/Loading'
66
importStartPagefrom'./containers/Start'
77
importSelectTutorialPagefrom'./containers/SelectTutorial'
88
importCompletedPagefrom'./containers/Tutorial/CompletedPage'
9-
importLevelSummaryPagefrom'./containers/Tutorial/LevelPage'
9+
importTutorialPagefrom'./containers/Tutorial'
1010

1111
constRoutes=()=>{
1212
const{ context, send, Router, Route}=useRouter()
@@ -30,21 +30,18 @@ const Routes = () => {
3030
<Routepath="Setup.Start">
3131
<StartPagesend={send}context={context}/>
3232
</Route>
33-
<Routepath={['Setup.LoadTutorialSummary','Setup.LoadTutorialData','Setup.SetupNewTutorial']}>
34-
<LoadingPagetext="Loading Tutorial..."processes={context.processes}/>]
35-
</Route>
3633
<Routepath="Setup.SelectTutorial">
3734
<SelectTutorialPagesend={send}context={context}/>
3835
</Route>
39-
<Routepath={['Setup.SetupNewTutorial','Setup.StartNewTutorial']}>
36+
<Routepath={['Setup.SetupNewTutorial','Setup.StartTutorial']}>
4037
<LoadingPagetext="Configuring tutorial..."/>
4138
</Route>
4239
{/* Tutorial */}
4340
<Routepath={['Tutorial.LoadNext','Tutorial.Level.Load']}>
4441
<LoadingPagetext="Loading Level..."processes={context.processes}/>
4542
</Route>
4643
<Routepath="Tutorial.Level">
47-
<LevelSummaryPagesend={send}context={context}/>
44+
<TutorialPagesend={send}context={context}/>
4845
</Route>
4946
{/* Completed */}
5047
<Routepath="Tutorial.Completed">

‎web-app/src/containers/Tutorial/LevelPage/index.tsxrenamed to‎web-app/src/containers/Tutorial/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import*asReactfrom'react'
22
import*asTfrom'typings'
33
import*asTTfrom'typings/tutorial'
4-
import*asselectorsfrom'../../../services/selectors'
5-
importLevelfrom'./Level'
4+
import*asselectorsfrom'../../services/selectors'
5+
importLevelfrom'./components/Level'
66

77
interfacePageProps{
88
context:T.MachineContext
99
send(action:T.Action):void
1010
}
1111

12-
constLevelSummaryPageContainer=(props:PageProps)=>{
12+
constTutorialPage=(props:PageProps)=>{
1313
const{ position, progress, processes, testStatus}=props.context
1414

1515
consttutorial=selectors.currentTutorial(props.context)
@@ -59,4 +59,4 @@ const LevelSummaryPageContainer = (props: PageProps) => {
5959
)
6060
}
6161

62-
exportdefaultLevelSummaryPageContainer
62+
exportdefaultTutorialPage

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ export const createMachine = (options: any) => {
123123
actions:['setError'],
124124
},
125125
TRY_AGAIN:'SetupNewTutorial',
126-
TUTORIAL_CONFIGURED:'StartNewTutorial',
126+
TUTORIAL_CONFIGURED:'StartTutorial',
127127
},
128128
},
129-
StartNewTutorial:{
129+
StartTutorial:{
130130
onEntry:['startNewTutorial'],
131131
after:{
132132
0:'#tutorial',

‎web-app/stories/Completed.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ import SideBarDecorator from './utils/SideBarDecorator'
66

77
storiesOf('Completed',module)
88
.addDecorator(SideBarDecorator)
9-
.add('Page',()=><CompletedPagecontext={{}}send={action('send')}/>)
9+
.add('Page',()=><CompletedPagecontext={{}}/>)

‎web-app/stories/Level.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { storiesOf } from '@storybook/react'
44
importReactfrom'react'
55
import*asTfrom'../../typings'
66
import*asTTfrom'../../typings/tutorial'
7-
importLevelfrom'../src/containers/Tutorial/LevelPage/Level'
7+
importLevelfrom'../src/containers/Tutorial/components/Level'
88
importSideBarDecoratorfrom'./utils/SideBarDecorator'
99

1010
typeModifiedLevel=TT.Level&{

‎web-app/stories/Step.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { action } from '@storybook/addon-actions'
22
import{select,text,withKnobs}from'@storybook/addon-knobs'
33
import{storiesOf}from'@storybook/react'
44
importReactfrom'react'
5-
importStepfrom'../src/containers/Tutorial/LevelPage/Step'
5+
importStepfrom'../src/containers/Tutorial/components/Step'
66
importSideBarDecoratorfrom'./utils/SideBarDecorator'
77

88
conststepText=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp