Delay modal rendering until open

This commit is contained in:
Lukas Martinelli 2016-12-22 14:21:53 +01:00
parent a5a7dab8e7
commit fed8c6b0ea

View file

@ -121,22 +121,25 @@ export default class Toolbar extends React.Component {
top: 0, top: 0,
backgroundColor: colors.black backgroundColor: colors.black
}}> }}>
<SettingsModal {this.state.openSettingsModal && <SettingsModal
mapStyle={this.props.mapStyle} mapStyle={this.props.mapStyle}
onStyleChanged={this.props.onStyleChanged} onStyleChanged={this.props.onStyleChanged}
isOpen={this.state.openSettingsModal} isOpen={this.state.openSettingsModal}
toggle={() => this.toggleSettings.bind(this)} toggle={() => this.toggleSettings.bind(this)}
/> />
<OpenModal }
isOpen={this.state.openOpenModal} {this.state.openOpenModal &&<OpenModal
toggle={() => this.toggleOpen.bind(this)} isOpen={this.state.openOpenModal}
/> toggle={() => this.toggleOpen.bind(this)}
<SourcesModal />
mapStyle={this.props.mapStyle} }
onStyleChanged={this.props.onStyleChanged} {this.state.openSourcesModal && <SourcesModal
isOpen={this.state.openSourcesModal} mapStyle={this.props.mapStyle}
toggle={() => this.toggleSources.bind(this)} onStyleChanged={this.props.onStyleChanged}
/> isOpen={this.state.openSourcesModal}
toggle={() => this.toggleSources.bind(this)}
/>
}
<ToolbarAction style={{ <ToolbarAction style={{
width: 180, width: 180,
textAlign: 'left', textAlign: 'left',