Added semi-hidden debug modal and removed all this url param awkwardness

This commit is contained in:
orangemug
2019-05-18 18:54:10 +01:00
parent c3c0c35d8a
commit d2ffc3a0b1
3 changed files with 67 additions and 4 deletions

View File

@@ -0,0 +1,36 @@
import React from 'react'
import PropTypes from 'prop-types'
import Modal from './Modal'
class DebugModal extends React.Component {
static propTypes = {
isOpen: PropTypes.bool.isRequired,
onOpenToggle: PropTypes.func.isRequired,
debugOptions: PropTypes.object,
}
render() {
return <Modal
data-wd-key="debug-modal"
isOpen={this.props.isOpen}
onOpenToggle={this.props.onOpenToggle}
title={'Debug'}
>
<div className="maputnik-modal-section maputnik-modal-shortcuts">
<ul>
{Object.entries(this.props.debugOptions).map(([key, val]) => {
return <li key={key}>
<label>
<input type="checkbox" value={val} onClick={(e) => this.props.onChangeDebug(key, e.target.checked)} /> {key}
</label>
</li>
})}
</ul>
</div>
</Modal>
}
}
export default DebugModal;

View File

@@ -40,6 +40,10 @@ class ShortcutsModal extends React.Component {
key: "m",
text: "Focus map"
},
{
key: "!",
text: "Debug modal"
},
]