summaryrefslogtreecommitdiff
path: root/ui/app/components/debug_panel.js
blob: 7515ba8433d146c1777737a220958f06e21b3b4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from 'react'
import App from '../app'


class DebugPanel extends React.Component {

  constructor(props) {
    super(props)
    this.click = this.click.bind(this)
  }

  componentDidMount() {
    this.click(window.location.hash.replace('#', ''))
  }

  click(panel_name) {
    window.location.hash = panel_name
    App.show(panel_name)
  }

  panel(panel_name) {
    return elem(
      'a',
      { onClick: () => this.click(panel_name), key: panel_name },
      panel_name
    )
  }

  render() {
    return elem('div', {className: 'debug-panel'},
      this.panel('splash'),
      this.panel('greeter'),
      this.panel('wizard'),
      this.panel('main')
    )
  }

}

export default DebugPanel