import React from 'react'; // import fs from 'fs'; // import { exec } from 'child_process'; import { inject, observer } from 'mobx-react'; import * as _ from 'lodash'; import { AppState } from '../../state/AppState'; import './Content.scss'; interface Props { AppState?: AppState; } @inject('AppState') @observer export class Content extends React.Component { constructor() { super(); this.state = { path: '', }; } // private async startGame(): Promise { // const { path } = this.state; // // set the realm list // await this.setRealmList(); // // launch wow // exec(`"${path}/WoW.exe"`, (err, output) => { // console.log(err); // console.log(output); // }); // } // private setRealmList(): Promise { // const { path } = this.state; // return new Promise((resolve, reject) => { // fs.writeFile(`${path}/realmlist.wtf`, 'set realmlist logon.elysium-project.org', err => { // err ? reject(err) : resolve(); // }); // }); // } private onFolderSelect(e: React.ChangeEvent): void { const path: string = _.get(e, `target.files[0].path`); if (path) { this.props.AppState.setDirectory(path); } } private onInputChange(e: any): void { this.props.AppState.setDirectory(e.target.value); } public render(): any { const { selectedExpansion } = this.props.AppState; return (
); } }