2
2
* Copyright (c) 2013-present, Facebook, Inc.
3
3
*
4
4
* @emails react-core
5
+ * @flow
5
6
*/
6
7
7
8
'use strict' ;
8
9
9
10
import Container from 'components/Container' ;
10
- import { Component , React } from 'react' ;
11
+ import React , { Component } from 'react' ;
11
12
import Sidebar from 'templates/components/Sidebar' ;
12
13
import { colors , media } from 'theme' ;
13
14
import ChevronSvg from 'templates/components/ChevronSvg' ;
14
15
15
- class StickyResponsiveSidebar extends Component {
16
- constructor ( props , context ) {
17
- super ( props , context ) ;
16
+ type State = {
17
+ open : boolean ,
18
+ } ;
19
+
20
+ type Props = {
21
+ enableScrollSync ?: boolean ,
22
+ createLink : Function , // TODO: Add better flow type once we Flow-type createLink
23
+ defaultActiveSection : string ,
24
+ location : Location ,
25
+ sectionList : Array < Object > , // TODO: Add better flow type once we have the Section component
26
+ } ;
27
+
28
+ class StickyResponsiveSidebar extends Component < Props , State > {
29
+ constructor ( props : Props ) {
30
+ super ( props ) ;
18
31
19
32
this . state = {
20
33
open : false ,
@@ -23,6 +36,9 @@ class StickyResponsiveSidebar extends Component {
23
36
this . _closeNavMenu = this . _closeNavMenu . bind ( this ) ;
24
37
}
25
38
39
+ _openNavMenu : Function ;
40
+ _closeNavMenu : Function ;
41
+
26
42
_openNavMenu ( ) {
27
43
this . setState ( { open : ! this . state . open } ) ;
28
44
}
0 commit comments