1
1
import * as React from 'react' ;
2
2
3
- import SectionItem from './sectionItem' ;
4
- import SectionGroupItem from './sectionGroupItem' ;
5
- import GlobalProps from '../props/globalProps' ;
6
- import Notebook from '../oneNoteDataStructures/notebook' ;
7
- import OneNoteItemUtils from '../oneNoteDataStructures/oneNoteItemUtils' ;
3
+ import { SectionItem } from './sectionItem' ;
4
+ import { SectionGroupItem } from './sectionGroupItem' ;
5
+ import { GlobalProps } from '../props/globalProps' ;
6
+ import { Notebook } from '../oneNoteDataStructures/notebook' ;
7
+ import { OneNoteItemUtils } from '../oneNoteDataStructures/oneNoteItemUtils' ;
8
8
9
9
export interface NotebookItemProps extends GlobalProps {
10
10
notebook : Notebook ;
@@ -17,7 +17,7 @@ export interface NotebookItemState {
17
17
export class NotebookItem extends React . Component < NotebookItemProps , NotebookItemState > {
18
18
constructor ( props ) {
19
19
super ( props ) ;
20
- this . state = { expanded : props . expanded } ;
20
+ this . state = { expanded : props . expanded } ;
21
21
}
22
22
23
23
private onClick ( ) {
@@ -28,7 +28,7 @@ export class NotebookItem extends React.Component<NotebookItemProps, NotebookIte
28
28
29
29
// We are only interested in expanding if either sections/pages are deemed selectable
30
30
if ( this . isExpandable ( ) ) {
31
- this . setState ( { expanded : ! this . state . expanded } ) ;
31
+ this . setState ( { expanded : ! this . state . expanded } ) ;
32
32
}
33
33
}
34
34
@@ -46,21 +46,25 @@ export class NotebookItem extends React.Component<NotebookItemProps, NotebookIte
46
46
47
47
return (
48
48
< li aria-selected = { isSelected } aria-expanded = { this . state . expanded } role = 'treeitem' >
49
- < a className = { isSelected ? 'picker-selectedItem' : '' } onClick = { this . onClick . bind ( this ) } tabIndex = { 0 } href = '#' >
49
+ < a className = { isSelected ? 'picker-selectedItem' : '' } onClick = { this . onClick . bind ( this ) } tabIndex = { 0 }
50
+ href = '#' >
50
51
< div className = 'picker-icon-left' >
51
52
< img src = { require ( '../images/notebook_icon.png' ) } />
52
53
</ div >
53
54
< div >
54
55
< label className = 'ms-fontSize-sPlus' > { this . props . notebook . name } </ label >
55
56
</ div >
56
57
</ a >
57
- < ul role = 'group' className = 'picker-list-header' style = { this . state . expanded ? { display : 'block' } : { display : 'none' } } >
58
- { this . props . notebook . sectionGroups . map ( sectionGroup => < SectionGroupItem globals = { this . props . globals } sectionGroup = { sectionGroup } key = { sectionGroup . name } > </ SectionGroupItem > ) }
59
- { this . props . notebook . sections . map ( section => < SectionItem globals = { this . props . globals } section = { section } key = { section . name } > </ SectionItem > ) }
58
+ < ul role = 'group' className = 'picker-list-header'
59
+ style = { this . state . expanded ? { display : 'block' } : { display : 'none' } } >
60
+ { this . props . notebook . sectionGroups . map ( sectionGroup => < SectionGroupItem
61
+ globals = { this . props . globals } sectionGroup = { sectionGroup }
62
+ key = { sectionGroup . name } > </ SectionGroupItem > ) }
63
+ { this . props . notebook . sections . map ( section => < SectionItem globals = { this . props . globals }
64
+ section = { section }
65
+ key = { section . name } > </ SectionItem > ) }
60
66
</ ul >
61
67
</ li >
62
68
) ;
63
69
}
64
70
}
65
-
66
- export default NotebookItem ;
0 commit comments