diff options
author | elijah <elijah@riseup.net> | 2016-09-16 14:02:32 -0700 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-22 11:40:11 -0400 |
commit | 073393af311d36c8ca7570ff0d3f0a3117c0b544 (patch) | |
tree | e59286ac350ba17110392f53b6e48bcedfd12ef1 /www/app/components/panel_switcher.js | |
parent | ae5a20d059209f2027c05820dc3b4cfe7346c8a8 (diff) |
[pkg] rename www to ui
Diffstat (limited to 'www/app/components/panel_switcher.js')
-rw-r--r-- | www/app/components/panel_switcher.js | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/www/app/components/panel_switcher.js b/www/app/components/panel_switcher.js deleted file mode 100644 index aaf2dc5b..00000000 --- a/www/app/components/panel_switcher.js +++ /dev/null @@ -1,58 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' - -import DebugPanel from './debug_panel' -import Splash from './splash' -import GreeterPanel from './greeter_panel' -import MainPanel from './main_panel' -import Wizard from './wizard' - -import App from 'app' -import 'lib/common' - -export default class PanelSwitcher extends React.Component { - - constructor(props) { - super(props) - this.state = { - panel: null, - panel_properties: null, - debug: false - } - App.switcher = this - } - - show(component_name, properties={}) { - this.setState({panel: component_name, panel_properties: properties}) - } - - render() { - let elems = [] - if (this.panelExist(this.state.panel)) { - elems.push( - this.panelRender(this.state.panel, this.state.panel_properties) - ) - } - if (this.state.debug) { - elems.push( - elem(DebugPanel, {key: 'debug'}) - ) - } - return <div id="root">{elems}</div> - } - - panelExist(panel) { - return panel && this['render_'+panel] - } - - panelRender(panel_name, props) { - let panel = this['render_'+panel_name](props) - return elem('div', {key: 'panel'}, panel) - } - - render_splash(props) {return elem(Splash, props)} - render_wizard(props) {return elem(Wizard, props)} - render_greeter(props) {return elem(GreeterPanel, props)} - render_main(props) {return elem(MainPanel, props)} - -} |