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

Commit96dcfe1

Browse files
committed
initiate side menu
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent85d0875 commit96dcfe1

File tree

2 files changed

+108
-3
lines changed

2 files changed

+108
-3
lines changed

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import*asReactfrom'react'
22
import*asTfrom'typings'
33
import*asTTfrom'typings/tutorial'
4-
//import {Dropdown } from '@alifd/next'
4+
import{Button,Drawer}from'@alifd/next'
55
import*asselectorsfrom'../../services/selectors'
66
importLevelfrom'./components/Level'
7-
//import Icon from '../../components/Icon'
7+
importIconfrom'../../components/Icon'
88

99
conststyles={
1010
header:{
@@ -56,10 +56,20 @@ const TutorialPage = (props: PageProps) => {
5656

5757
constlevelIndex=tutorial.levels.findIndex((l:TT.Level)=>l.id===position.levelId)
5858
constlevelStatus=progress.levels[position.levelId] ?'COMPLETE' :'ACTIVE'
59+
const[menuVisible,setMenuVisible]=React.useState(false)
60+
61+
constonMenuClose=()=>{
62+
setMenuVisible(false)
63+
}
5964

6065
return(
6166
<div>
62-
<divcss={styles.header}>{tutorial.summary.title}</div>
67+
<divcss={styles.header}>
68+
<ButtononClick={()=>setMenuVisible(!menuVisible)}>
69+
<Icontype="menu"/>
70+
</Button>
71+
{tutorial.summary.title}
72+
</div>
6373
<Level
6474
tutorial={tutorial}
6575
index={levelIndex}
@@ -73,6 +83,9 @@ const TutorialPage = (props: PageProps) => {
7383
processes={processes}
7484
testStatus={testStatus}
7585
/>
86+
<Drawertitle="Menu Title"visible={menuVisible}placement="left"onClose={onMenuClose}>
87+
Menu content here
88+
</Drawer>
7689
</div>
7790
)
7891
}

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

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import{action}from'@storybook/addon-actions'
2+
import{withKnobs}from'@storybook/addon-knobs'
3+
import{storiesOf}from'@storybook/react'
4+
importReactfrom'react'
5+
import*asTfrom'../../typings'
6+
import*asTTfrom'../../typings/tutorial'
7+
importTutorialfrom'../src/containers/Tutorial'
8+
importSideBarDecoratorfrom'./utils/SideBarDecorator'
9+
10+
typeModifiedLevel=TT.Level&{
11+
status:T.ProgressStatus
12+
index:number
13+
steps:Array<TT.Step&{status:T.ProgressStatus}>
14+
}
15+
16+
constcontext:Partial<T.MachineContext>={
17+
env:{machineId:'',sessionId:'',token:''},
18+
error:null,
19+
position:{levelId:'1',stepId:'1.1'},
20+
progress:{levels:{},steps:{},complete:false},
21+
processes:[],
22+
testStatus:null,
23+
tutorial:{
24+
id:'',
25+
version:'0.1.0',
26+
config:{
27+
appVersions:{vscode:'0.1.0'},
28+
testRunner:{
29+
command:'',
30+
args:{tap:''},
31+
},
32+
repo:{
33+
branch:'',
34+
uri:'',
35+
},
36+
},
37+
summary:{
38+
title:'Example Title',
39+
description:'An example description',
40+
},
41+
levels:[
42+
{
43+
id:'1',
44+
title:'A Title',
45+
summary:'A summary of the level',
46+
content:'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!',
47+
setup:null,
48+
status:'ACTIVE'as'ACTIVE',
49+
steps:[
50+
{
51+
id:'1.1',
52+
content:'Should support markdown test\n ```shell\nnpn install some-packagen```\nwhew it works!',
53+
setup:{
54+
commits:['abcdefg'],
55+
},
56+
solution:{
57+
commits:['hijklmn'],
58+
},
59+
status:'COMPLETE',
60+
},
61+
{
62+
id:'1.2',
63+
content:'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!',
64+
setup:{
65+
commits:['abcdefg'],
66+
},
67+
solution:{
68+
commits:['hijklmn'],
69+
},
70+
status:'ACTIVE',
71+
},
72+
{
73+
id:'1.3',
74+
content:'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!',
75+
setup:{
76+
commits:['abcdefg'],
77+
},
78+
solution:{
79+
commits:['hijklmn'],
80+
},
81+
status:'INCOMPLETE',
82+
},
83+
],
84+
},
85+
],
86+
},
87+
}
88+
89+
storiesOf('Tutorial',module)
90+
.addDecorator(SideBarDecorator)
91+
.addDecorator(withKnobs)
92+
.add('Example',()=><Tutorialcontext={context}send={action('send')}/>)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp