import React from 'react' import FileReaderInput from 'react-file-reader-input' import MdFileDownload from 'react-icons/lib/md/file-download' import MdFileUpload from 'react-icons/lib/md/file-upload' import MdOpenInBrowser from 'react-icons/lib/md/open-in-browser' import MdSettings from 'react-icons/lib/md/settings' import MdInfo from 'react-icons/lib/md/info' import MdLayers from 'react-icons/lib/md/layers' import MdSave from 'react-icons/lib/md/save' import MdStyle from 'react-icons/lib/md/style' import MdMap from 'react-icons/lib/md/map' import MdInsertEmoticon from 'react-icons/lib/md/insert-emoticon' import MdFontDownload from 'react-icons/lib/md/font-download' import MdHelpOutline from 'react-icons/lib/md/help-outline' import MdFindInPage from 'react-icons/lib/md/find-in-page' import SettingsModal from './modals/SettingsModal' import SourcesModal from './modals/SourcesModal' import OpenModal from './modals/OpenModal' import style from '../libs/style' import colors from '../config/colors' import { margins, fontSizes } from '../config/scales' const IconText = props => {props.children} const ToolbarAction = props => {props.children} export default class Toolbar extends React.Component { static propTypes = { mapStyle: React.PropTypes.object.isRequired, onStyleChanged: React.PropTypes.func.isRequired, // A new style has been uploaded onStyleUpload: React.PropTypes.func.isRequired, // Current style is requested for download onStyleDownload: React.PropTypes.func.isRequired, // Style is explicitely saved to local cache onStyleSave: React.PropTypes.func, } constructor(props) { super(props) this.state = { openSettingsModal: false, openSourcesModal: false, openOpenModal: false, } } saveButton() { if(this.props.mapStyle.layers.length > 0) { return Save } return null } downloadButton() { return Download } toggleSettings() { this.setState({openSettingsModal: !this.state.openSettingsModal}) } toggleSources() { this.setState({openSourcesModal: !this.state.openSourcesModal}) } toggleOpen() { this.setState({openOpenModal: !this.state.openOpenModal}) } render() { return
this.toggleSettings.bind(this)} /> this.toggleOpen.bind(this)} /> this.toggleSources.bind(this)} /> Maputnik Maputnik Open {this.downloadButton()} {this.saveButton()} Sources Style Settings Inspect Help
} }