11import React from 'react'
22import * as G from '../../typings/graphql'
3+ import * as T from '../../typings'
34
45import { action } from '@storybook/addon-actions'
56import { withKnobs } from '@storybook/addon-knobs'
@@ -8,11 +9,17 @@ import { storiesOf } from '@storybook/react'
89import SideBarDecorator from './utils/SideBarDecorator'
910import Level from '../src/containers/Tutorial/LevelPage/Level/index'
1011
12+ type ModifiedLevel = G . Level & {
13+ status : T . ProgressStatus
14+ index : number
15+ steps : Array < G . Step & { status : T . ProgressStatus } >
16+ }
17+
1118storiesOf ( 'Level' , module )
1219 . addDecorator ( SideBarDecorator )
1320 . addDecorator ( withKnobs )
1421 . add ( 'Level' , ( ) => {
15- const level : G . Level & { index : number } = {
22+ const level = {
1623 id : 'L1' ,
1724 index : 2 ,
1825 title : 'A Title' ,
@@ -67,3 +74,49 @@ storiesOf('Level', module)
6774 }
6875 return < Level level = { level } onContinue = { action ( 'onContinue' ) } onLoadSolution = { action ( 'onLoadSolution' ) } />
6976 } )
77+ . add ( 'Level 2' , ( ) => {
78+ const level = {
79+ id : 'L1' ,
80+ title : 'A Title' ,
81+ description : 'A description' ,
82+ content : 'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!' ,
83+ setup : { commits : [ '77e57cd' ] , commands : [ 'npm install' ] , files : [ ] } ,
84+ steps : [
85+ {
86+ id : 'L1:S1' ,
87+ content : 'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!' ,
88+ setup : { commits : [ 'a4679b1' ] , commands : [ ] , files : [ 'package.json' ] } ,
89+ solution : {
90+ commits : [ '7c64508' ] ,
91+ commands : [ 'npm install' ] ,
92+ files : [ 'package.json' ] ,
93+ } ,
94+ status : 'ACTIVE' ,
95+ } ,
96+ {
97+ id : 'L1:S2' ,
98+ content : 'Should support markdown test\n ```ts\nvar a = 1\n```\nwhew it works!' ,
99+ setup : { commits : [ '8a8a5cb' ] , commands : [ ] , files : [ 'src/main.ts' ] } ,
100+ solution : { commits : [ 'c2f7973' ] , commands : [ ] , files : [ 'src/main.ts' ] } ,
101+ status : 'INCOMPLETE' ,
102+ } ,
103+ {
104+ id : 'L1:S3' ,
105+ content : 'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!' ,
106+ setup : { commits : [ '992bcb1' ] , commands : [ ] , files : [ 'src/main.ts' ] } ,
107+ solution : { commits : [ '1b92779' ] , commands : [ ] , files : [ 'src/main.ts' ] } ,
108+ status : 'INCOMPLETE' ,
109+ } ,
110+ {
111+ id : 'L1:S4' ,
112+ content : 'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!' ,
113+ setup : { commits : [ 'be32adb' ] , commands : [ ] , files : [ 'src/main.ts' ] } ,
114+ solution : { commits : [ '7fe26cb' ] , commands : [ ] , files : [ 'src/main.ts' ] } ,
115+ status : 'INCOMPLETE' ,
116+ } ,
117+ ] ,
118+ index : 0 ,
119+ status : 'ACTIVE' ,
120+ }
121+ return < Level level = { level } onContinue = { action ( 'onContinue' ) } onLoadSolution = { action ( 'onLoadSolution' ) } />
122+ } )
0 commit comments