Switch text in inspect button #64

This commit is contained in:
Lukas Martinelli 2017-01-11 16:23:33 +01:00
parent 82da251218
commit bbe45cf8ee
2 changed files with 6 additions and 1 deletions

View file

@ -227,6 +227,7 @@ export default class App extends React.Component {
const toolbar = <Toolbar
mapStyle={this.state.mapStyle}
inspectModeEnabled={this.state.inspectModeEnabled}
sources={this.state.sources}
onStyleChanged={this.onStyleChanged.bind(this)}
onStyleOpen={this.onStyleChanged.bind(this)}

View file

@ -49,6 +49,7 @@ function ToolbarAction(props) {
export default class Toolbar extends React.Component {
static propTypes = {
mapStyle: React.PropTypes.object.isRequired,
inspectModeEnabled: React.PropTypes.bool.isRequired,
onStyleChanged: React.PropTypes.func.isRequired,
// A new style has been uploaded
onStyleOpen: React.PropTypes.func.isRequired,
@ -128,7 +129,10 @@ export default class Toolbar extends React.Component {
</ToolbarAction>
<ToolbarAction onClick={this.props.onInspectModeToggle}>
<InspectionIcon />
<IconText>Inspect</IconText>
<IconText>
{ this.props.inspectModeEnabled && <span>Map Mode</span> }
{ !this.props.inspectModeEnabled && <span>Inspect Mode</span> }
</IconText>
</ToolbarAction>
<ToolbarLink href={"https://github.com/maputnik/editor/wiki"}>
<HelpIcon />