mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-15 09:21:19 +01:00
Added <UrlInput/> to open modal.
This commit is contained in:
parent
e728e5f7e4
commit
2e017d252a
1 changed files with 6 additions and 6 deletions
|
@ -4,6 +4,7 @@ import LoadingModal from './LoadingModal'
|
||||||
import Modal from './Modal'
|
import Modal from './Modal'
|
||||||
import Button from '../Button'
|
import Button from '../Button'
|
||||||
import FileReaderInput from 'react-file-reader-input'
|
import FileReaderInput from 'react-file-reader-input'
|
||||||
|
import UrlInput from '../inputs/UrlInput'
|
||||||
|
|
||||||
import {MdFileUpload} from 'react-icons/md'
|
import {MdFileUpload} from 'react-icons/md'
|
||||||
import {MdAddCircleOutline} from 'react-icons/md'
|
import {MdAddCircleOutline} from 'react-icons/md'
|
||||||
|
@ -160,9 +161,9 @@ class OpenModal extends React.Component {
|
||||||
this.props.onOpenToggle();
|
this.props.onOpenToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeUrl = () => {
|
onChangeUrl = (url) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
styleUrl: this.styleUrlElement.value
|
styleUrl: url,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,14 +210,13 @@ class OpenModal extends React.Component {
|
||||||
<p>
|
<p>
|
||||||
Load from a URL. Note that the URL must have <a href="https://enable-cors.org" target="_blank" rel="noopener noreferrer">CORS enabled</a>.
|
Load from a URL. Note that the URL must have <a href="https://enable-cors.org" target="_blank" rel="noopener noreferrer">CORS enabled</a>.
|
||||||
</p>
|
</p>
|
||||||
<input
|
<UrlInput
|
||||||
data-wd-key="open-modal.url.input"
|
data-wd-key="open-modal.url.input"
|
||||||
type="text"
|
type="text"
|
||||||
ref={(input) => this.styleUrlElement = input}
|
|
||||||
className="maputnik-input"
|
className="maputnik-input"
|
||||||
placeholder="Enter URL..."
|
default="Enter URL..."
|
||||||
value={this.state.styleUrl}
|
value={this.state.styleUrl}
|
||||||
onChange={this.onChangeUrl}
|
onInput={this.onChangeUrl}
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
|
|
Loading…
Reference in a new issue