@infect/frontend
Version:
infect frontend
38 lines (33 loc) • 909 B
JSX
import React from 'react';
import { observer } from 'mobx-react';
import debug from 'debug';
const log = debug('infect:InfoOverlayButtonComponent');
export default class InfoOverlayButton extends React.Component {
toggleInfoOverlay() {
log('Toggle overlay');
// this.props.infoOverlay.toggle();
if (window.location.hash === '#information') {
window.location.hash = '';
} else {
window.location.hash = '#information';
}
}
render() {
return (
<button
className={ 'button button--info ' + (this.props.infoOverlay.visible ? 'button--info-active' : '') }
onClick={ () => this.toggleInfoOverlay() }>
{ !this.props.infoOverlay.visible &&
<div>
<span>ⓘ</span>
<span>About <em>INFECT</em></span>
</div>
}
{ this.props.infoOverlay.visible &&
<span>×</span>
}
</button>
);
}
}