File tree Expand file tree Collapse file tree 2 files changed +59
-8
lines changed
web-app/src/containers/Tutorial Expand file tree Collapse file tree 2 files changed +59
-8
lines changed Original file line number Diff line number Diff line change 1+ import * as React from 'react'
2+ import { Menu , Icon , Drawer } from '@alifd/next'
3+
4+ const { Item, Divider } = Menu
5+
6+ const styles = {
7+ drawer : {
8+ padding : 0 ,
9+ } ,
10+ menu : {
11+ margin : 0 ,
12+ height : '100%' ,
13+ } ,
14+ itemText : {
15+ marginLeft : '0.5rem' ,
16+ } ,
17+ }
18+
19+ interface Props {
20+ visible : boolean
21+ toggleVisible ( visible : boolean ) : void
22+ }
23+
24+ const SideMenu = ( props : Props ) => {
25+ const onMenuClose = ( ) => {
26+ props . toggleVisible ( false )
27+ }
28+ return (
29+ < Drawer
30+ bodyStyle = { styles . drawer }
31+ title = "Menu"
32+ visible = { props . visible }
33+ placement = "left"
34+ closeable = "mask"
35+ onClose = { onMenuClose }
36+ >
37+ < Menu style = { styles . menu } defaultOpenKeys = "sub-menu" >
38+ < Item disabled key = "1" >
39+ < Icon type = "list" size = "small" color = "#EBEBEB" />
40+ < span style = { styles . itemText } > Review</ span >
41+ </ Item >
42+ { /* <Divider key="divider" />
43+ <Item disabled key="2">
44+ <Icon type="help" size="small" color="#EBEBEB" />
45+ <span style={styles.itemText}>Help</span>
46+ </Item> */ }
47+ < Divider key = "divider" />
48+ < Item disabled key = "3" >
49+ < Icon type = "set" size = "small" color = "#EBEBEB" />
50+ < span style = { styles . itemText } > Settings</ span >
51+ </ Item >
52+ </ Menu >
53+ </ Drawer >
54+ )
55+ }
56+
57+ export default SideMenu
Original file line number Diff line number Diff line change 11import * as React from 'react'
22import * as T from 'typings'
33import * as TT from 'typings/tutorial'
4- import { Drawer } from '@alifd/next'
54import * as selectors from '../../services/selectors'
5+ import SideMenu from './components/SideMenu'
66import Level from './components/Level'
77import Icon from '../../components/Icon'
88
@@ -61,10 +61,6 @@ const TutorialPage = (props: PageProps) => {
6161 const levelStatus = progress . levels [ position . levelId ] ? 'COMPLETE' : 'ACTIVE'
6262 const [ menuVisible , setMenuVisible ] = React . useState ( false )
6363
64- const onMenuClose = ( ) => {
65- setMenuVisible ( false )
66- }
67-
6864 return (
6965 < div >
7066 < div css = { styles . header } >
@@ -86,9 +82,7 @@ const TutorialPage = (props: PageProps) => {
8682 processes = { processes }
8783 testStatus = { testStatus }
8884 />
89- < Drawer title = "Menu Title" visible = { menuVisible } placement = "left" onClose = { onMenuClose } >
90- Menu content here
91- </ Drawer >
85+ < SideMenu visible = { menuVisible } toggleVisible = { setMenuVisible } />
9286 </ div >
9387 )
9488}
You can’t perform that action at this time.
0 commit comments