8
8
import AppBadge from 'components/AppBadge/AppBadge.react' ;
9
9
import html from 'lib/htmlString' ;
10
10
import { Link } from 'react-router' ;
11
- import React from 'react' ;
11
+ import React from 'react' ;
12
12
import styles from 'components/Sidebar/Sidebar.scss' ;
13
13
import { unselectable } from 'stylesheets/base.scss' ;
14
14
15
- let AppsMenu = ( { apps, current, height, onSelect } ) => (
16
- < div style = { { height } } className = { [ styles . appsMenu , unselectable ] . join ( ' ' ) } >
17
- < div className = { styles . currentApp } onClick = { onSelect . bind ( null , current . slug ) } >
18
- { current . name }
19
- </ div >
20
- < div className = { styles . menuSection } > All Apps</ div >
21
- { apps . map ( ( app ) => {
22
- if ( app . slug === current . slug ) {
23
- return null ;
24
- }
25
- return (
26
- < Link to = { { pathname : html `/apps/${ app . slug } /browser` } } key = { app . slug } className = { styles . menuRow } >
27
- { app . name }
28
- < AppBadge production = { app . production } />
29
- </ Link >
30
- ) ;
31
- } ) }
32
- </ div >
33
- ) ;
15
+ export default class AppsMenu extends React . Component {
16
+ render ( ) {
17
+ const { apps, current, height, onSelect } = this . props ;
18
+ return (
19
+ < div style = { { height } } className = { [ styles . appsMenu , unselectable ] . join ( ' ' ) } >
20
+ < div className = { styles . currentApp } onClick = { onSelect . bind ( null , current . slug ) } >
21
+ { current . name }
22
+ </ div >
23
+ < div className = { styles . menuSection } > All Apps</ div >
24
+ { apps . map ( ( app ) => {
25
+ if ( app . slug === current . slug ) {
26
+ return null ;
27
+ }
28
+ return (
29
+ < Link to = { { pathname : html `/apps/${ app . slug } /browser` } } key = { app . slug } className = { styles . menuRow } >
30
+ { app . name }
31
+ < AppBadge production = { app . production } />
32
+ </ Link >
33
+ ) ;
34
+ } ) }
35
+ </ div >
36
+ ) ;
37
+ }
38
+ }
34
39
35
- export default AppsMenu ;
40
+ AppsMenu . contextTypes = {
41
+ router : React . PropTypes . object
42
+ } ;
0 commit comments