fix: Hide info if requested
This commit is contained in:
parent
658fed75da
commit
51d0011ed0
|
@ -38,7 +38,7 @@ export class EmulatorInfo extends React.Component<
|
|||
|
||||
return (
|
||||
<div id="status">
|
||||
Disk: <span>{disk}</span>| CPU Speed: <span>{cpu}</span>|{" "}
|
||||
Disk: <span>{disk}</span> | CPU Speed: <span>{cpu}</span> |{" "}
|
||||
<a href="#" onClick={this.props.toggleInfo}>
|
||||
Hide
|
||||
</a>
|
||||
|
|
|
@ -216,12 +216,7 @@ export class Emulator extends React.Component<{}, EmulatorState> {
|
|||
public render() {
|
||||
return (
|
||||
<>
|
||||
<EmulatorInfo
|
||||
emulator={this.state.emulator}
|
||||
toggleInfo={() => {
|
||||
this.setState({ isInfoDisplayed: !this.state.isInfoDisplayed });
|
||||
}}
|
||||
/>
|
||||
{this.renderInfo()}
|
||||
{this.renderUI()}
|
||||
<div id="emulator">
|
||||
<div></div>
|
||||
|
@ -231,6 +226,22 @@ export class Emulator extends React.Component<{}, EmulatorState> {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the little info thingy
|
||||
*/
|
||||
public renderInfo() {
|
||||
if (!this.state.isInfoDisplayed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <EmulatorInfo
|
||||
emulator={this.state.emulator}
|
||||
toggleInfo={() => {
|
||||
this.setState({ isInfoDisplayed: !this.state.isInfoDisplayed });
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
/**
|
||||
* Boot the emulator without restoring state
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue