Added <UrlInput/> to open modal.

This commit is contained in:
orangemug 2019-10-27 17:36:20 +00:00
parent e728e5f7e4
commit 2e017d252a

View file

@ -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