Skip to content

Commit 6b04790

Browse files
author
Krit
committed
revert AppsMenu.react back to stateless component
1 parent b2d308c commit 6b04790

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

src/components/Sidebar/AppsMenu.react.js

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,24 @@ import React from 'react';
1212
import styles from 'components/Sidebar/Sidebar.scss';
1313
import { unselectable } from 'stylesheets/base.scss';
1414

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-
}
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={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+
);
3934

40-
AppsMenu.contextTypes = {
41-
router: React.PropTypes.object
42-
};
35+
export default AppsMenu;

0 commit comments

Comments
 (0)