import { Menu, Select } from 'antd'; import { ClickParam } from 'antd/lib/menu'; import { observer } from 'mobx-react'; import React from 'react'; import './ApplicationComponent.less'; import { with_error_boundary } from './ErrorBoundary'; import { HuntOptimizerComponent } from './hunt_optimizer/HuntOptimizerComponent'; import { QuestEditorComponent } from './quest_editor/QuestEditorComponent'; import { DpsCalcComponent } from './dps_calc/DpsCalcComponent'; import { Server } from '../domain'; const QuestEditor = with_error_boundary(QuestEditorComponent); const HuntOptimizer = with_error_boundary(HuntOptimizerComponent); const DpsCalc = with_error_boundary(DpsCalcComponent); @observer export class ApplicationComponent extends React.Component { state = { tool: this.init_tool() } render() { let tool_component; switch (this.state.tool) { case 'questEditor': tool_component = ; break; case 'huntOptimizer': tool_component = ; break; case 'dpsCalc': tool_component = ; break; } return (

Phantasmal World

Quest Editor(Beta) Hunt Optimizer {/* DPS Calculator */}
Server:
{tool_component}
); } private menu_clicked = (e: ClickParam) => { this.setState({ tool: e.key }); }; private init_tool(): string { const param = window.location.search.slice(1).split('&').find(p => p.startsWith('tool=')); return param ? param.slice(5) : 'questEditor'; } }