Passed
Push — develop ( 6405a0...9011bf )
by Endre
03:30
created

SideMenu   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 28
dl 0
loc 29
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Functions

Rating   Name   Duplication   Size   Complexity  
A componentDidMount 0 4 1
A render 0 21 1
1
import * as mdc from 'material-components-web';
2
import React from 'react';
3
import ReactDOM from 'react-dom';
4
import Model from './SideMenu/Model';
5
6
export interface IProperties {
7
  model: Model
8
}
9
10
interface IState {
11
}
12
13
export default class SideMenu extends React.Component<IProperties, IState> {
14
  drawer: mdc.drawer.MDCDrawer | undefined;
15
16
  componentDidMount(): void {
17
    // @ts-ignore
18 2
    this.drawer = new mdc.drawer.MDCDrawer(ReactDOM.findDOMNode(this));
19
  }
20
21
  render(): React.ReactElement {
22 3
    this.drawer && (this.drawer.open = this.props.model.isOpen);
23 3
    return <aside className="mdc-drawer mdc-drawer--dismissible mdc-top-app-bar--fixed-adjust">
24
      <div className="mdc-drawer__content">
25
        <nav className="mdc-list">
26
          <a className="mdc-list-item mdc-list-item--activated" href="#" aria-current="page">
27
            <i className="material-icons mdc-list-item__graphic" aria-hidden="true">inbox</i>
28
            <span className="mdc-list-item__text">Inbox</span>
29
          </a>
30
          <a className="mdc-list-item" href="#">
31
            <i className="material-icons mdc-list-item__graphic" aria-hidden="true">send</i>
32
            <span className="mdc-list-item__text">Outgoing</span>
33
          </a>
34
          <a className="mdc-list-item" href="#">
35
            <i className="material-icons mdc-list-item__graphic" aria-hidden="true">drafts</i>
36
            <span className="mdc-list-item__text">Drafts</span>
37
          </a>
38
        </nav>
39
      </div>
40
    </aside>;
41
  }
42
}