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

Commit1259451

Browse files
committed
refactor tutorial pages
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent9168e37 commit1259451

File tree

9 files changed

+13
-17
lines changed

9 files changed

+13
-17
lines changed

‎web-app/src/Routes.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import ErrorView from './components/Error'
55
importLoadingPagefrom'./containers/Loading'
66
importStartPagefrom'./containers/Start'
77
importSelectTutorialPagefrom'./containers/SelectTutorial'
8-
importCompletedPagefrom'./containers/Tutorial/CompletedPage'
9-
importLevelSummaryPagefrom'./containers/Tutorial/LevelPage'
8+
importCompletedPagefrom'./containers/Tutorial/Completed'
9+
importTutorialPagefrom'./containers/Tutorial'
1010

1111
constRoutes=()=>{
1212
const{ context, send, Router, Route}=useRouter()
@@ -44,7 +44,7 @@ const Routes = () => {
4444
<LoadingPagetext="Loading Level..."/>
4545
</Route>
4646
<Routepath="Tutorial.Level">
47-
<LevelSummaryPagesend={send}context={context}/>
47+
<TutorialPagesend={send}context={context}/>
4848
</Route>
4949
{/* Completed */}
5050
<Routepath="Tutorial.Completed">

‎web-app/src/components/Error/index.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ interface Props {
3737
}
3838

3939
constErrorMarkdown=({ error, send}:Props)=>{
40-
React.useEffect(()=>{
41-
if(error){
42-
// log error
43-
console.log(`ERROR in markdown:${error.message}`)
44-
}
45-
},[error])
46-
4740
if(!error){
4841
returnnull
4942
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import*asReactfrom'react'
22
import*asTfrom'typings'
33
import{css,jsx}from'@emotion/core'
4-
importButtonfrom'../../components/Button'
4+
importButtonfrom'../../../components/Button'
55

66
conststyles={
77
page:{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ const Level = ({ level, onContinue, onLoadSolution, processes, testStatus }: Pro
9191
currentStep=level.steps.length
9292
}
9393

94+
console.log(`currentStep:${currentStep}`)
95+
9496
constpageBottomRef=React.useRef(null)
9597

9698
constscrollToBottom=()=>{

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import*asReactfrom'react'
22
import*asTfrom'typings'
33
import*asTTfrom'typings/tutorial'
4-
import*asselectorsfrom'../../../services/selectors'
4+
import*asselectorsfrom'../../services/selectors'
55
importLevelfrom'./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)
1616
constlevelData:TT.Level=selectors.currentLevel(props.context)
1717

1818
constonContinue=():void=>{
19+
console.log('onContinue triggered')
1920
props.send({
2021
type:'LEVEL_NEXT',
2122
payload:{
@@ -59,4 +60,4 @@ const LevelSummaryPageContainer = (props: PageProps) => {
5960
)
6061
}
6162

62-
exportdefaultLevelSummaryPageContainer
63+
exportdefaultTutorialPage

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import{action}from'@storybook/addon-actions'
22
import{storiesOf}from'@storybook/react'
33
importReactfrom'react'
4-
importCompletedPagefrom'../src/containers/Tutorial/CompletedPage'
4+
importCompletedPagefrom'../src/containers/Tutorial/Completed'
55
importSideBarDecoratorfrom'./utils/SideBarDecorator'
66

77
storiesOf('Completed',module)

‎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/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/Level/Step'
66
importSideBarDecoratorfrom'./utils/SideBarDecorator'
77

88
conststepText=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp