8 |
9 | {this.props.nav}
10 |
11 |
12 | {this.props.page}
13 |
14 |
15 | );
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/components/ApplicationLayout/ApplicationLayout.less:
--------------------------------------------------------------------------------
1 | .ApplicationLayout {
2 | height: 100%;
3 |
4 | &-nav {
5 | position: fixed;
6 |
7 | width: 256px;
8 | left: 0;
9 | top: 0;
10 | bottom: 0;
11 | }
12 |
13 | &-page {
14 | margin-left: 256px;
15 | height: 100%;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/components/Base.jsx:
--------------------------------------------------------------------------------
1 | import {Component, PropTypes} from "react";
2 | import classNames from "classnames";
3 |
4 |
5 | class Base extends Component {
6 | getComponentClasses(classNames, ...overrideClassNames) {
7 | return [
8 | this.constructor.name,
9 | this.c(classNames),
10 | this.props.className || "",
11 | this.c(overrideClassNames)
12 | ].join(' ');
13 | }
14 |
15 | c(...args) {
16 | return (
17 | classNames(...args)
18 | .split(/\s+/)
19 | .filter(name => name !== "")
20 | .map(name => `${this.constructor.name}-${name}`)
21 | .join(' ')
22 | );
23 | }
24 | }
25 |
26 | Base.propTypes = {
27 | className: PropTypes.string
28 | };
29 |
30 |
31 | export default Base;
32 |
--------------------------------------------------------------------------------
/src/components/BlackTrianglePage/BlackTrianglePage.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Base from "../Base";
3 |
4 | class BlackTriangle extends Base {
5 | render() {
6 | const adjustSpeed = this.context.Actions.BlackTriangle.adjustSpeed;
7 |
8 | return (
9 |