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

Commit2bc96a1

Browse files
committed
cleanup gql paths
1 parent204840f commit2bc96a1

File tree

7 files changed

+27
-23
lines changed

7 files changed

+27
-23
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import{Button,Step}from'@alifd/next'
22
import*asReactfrom'react'
3-
import*asTfrom'../../../../typings/graphql'
3+
import*asTfrom'typings/graphql'
44

55
importMarkdownfrom'../Markdown'
66
importLevelStageSummaryfrom'./LevelStageSummary'

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

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import{Button,Step}from'@alifd/next'
22
import*asReactfrom'react'
3-
importCRfrom'typings'
3+
import*asTfrom'typings/graphql'
44

55
importMarkdownfrom'../Markdown'
66
importStepDescriptionfrom'./StepDescription'
@@ -23,36 +23,39 @@ const styles = {
2323
}
2424

2525
interfaceProps{
26-
stage:CR.TutorialStage
27-
steps:{
28-
[stepId:string]:any// CC.Step
29-
}
26+
stage:T.Stage
3027
complete:boolean
3128
onContinue():void
3229
}
3330

34-
constStage=({ stage, steps, onContinue, complete}:Props)=>{
35-
const{ stepList, content}=stage
36-
const{ title, text}=content
31+
constStage=({ stage, onContinue, complete}:Props)=>{
32+
if(!stage.steps){
33+
thrownewError('No Stage steps found')
34+
}
35+
3736
// grab the active step
38-
constactiveIndex=stepList.findIndex((stepId:string)=>{
39-
returnsteps[stepId].status.active
37+
constactiveIndex:number=stage.steps.findIndex((step:T.Step|null)=>{
38+
returnstep&&step.status==='ACTIVE'
4039
})
40+
4141
return(
4242
<divstyle={styles.card}>
4343
<divstyle={styles.content}>
44-
<h2style={styles.title}>{title}</h2>
45-
<Markdown>{text}</Markdown>
44+
<h2style={styles.title}>{stage.title}</h2>
45+
<Markdown>{stage.text||''}</Markdown>
4646
</div>
4747
<divstyle={styles.steps}>
4848
<Stepcurrent={activeIndex}direction="ver"shape="dot"animationreadOnly>
49-
{stepList.map((stepId:string,index:number)=>{
50-
conststep=steps[stepId]
49+
{stage.steps.map((step:T.Step|null,index:number)=>{
50+
if(!step){
51+
returnnull
52+
}
53+
consthide=status==='INCOMPLETE'
5154
return(
5255
<Step.Item
53-
key={stepId}
54-
title={step.content.title||`Step${index+1}`}
55-
content={<StepDescriptioncontent={step.content}status={step.status}/>}
56+
key={step.id}
57+
title={step.title||`Step${index+1}`}
58+
content={<StepDescriptiontext={step.text}hide={hide}/>}
5659
/>
5760
)
5861
})}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import*asReactfrom'react'
22

3-
import*asTfrom'../../../../typings/graphql'
3+
import*asTfrom'typings/graphql'
44
importTutorialItemfrom'./TutorialItem'
55

66
interfaceProps{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import*asReactfrom'react'
22
import{useQuery}from'@apollo/react-hooks'
33
import{Button,Card}from'@alifd/next'
4+
import*asTfrom'typings/graphql'
45

56
import{send}from'../../utils/vscode'
67
importLoadingPagefrom'../LoadingPage'
78
importqueryTutorialfrom'./queryTutorial'
89
importErrorViewfrom'../../components/Error'
9-
import*asTfrom'../../../../typings/graphql'
1010

1111
interfaceProps{
1212
tutorial:T.Tutorial

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import*asReactfrom'react'
22
import{useQuery}from'@apollo/react-hooks'
3-
import*asTfrom'../../../../typings/graphql'
3+
import*asTfrom'typings/graphql'
44

55
importqueryTutorialsfrom'./queryTutorials'
66
import{send}from'../../utils/vscode'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import*asReactfrom'react'
22
import{useQuery}from'@apollo/react-hooks'
3+
import*asTfrom'typings/graphql'
34

45
importErrorViewfrom'../../../components/Error'
56
importLevelfrom'../../../components/Level'
6-
import*asTfrom'../../../../../typings/graphql'
77
importqueryLevelfrom'./queryLevel'
88

99
interfaceLevelProps{

‎web-app/tsconfig.paths.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"baseUrl":"src",
44
"rootDirs": ["src","stories"],
55
"paths": {
6-
"typings": ["../../typings/index.d.ts"]
6+
"typings": ["../../typings/index.d.ts"],
7+
"typings/graphql": ["../../typings/graphql.d.ts"]
78
},
89
"allowSyntheticDefaultImports":true
910
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp