mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-27 20:47:58 +01:00
Added dialog styling.
This commit is contained in:
parent
7167235146
commit
558f3d649d
2 changed files with 18 additions and 7 deletions
|
@ -67,7 +67,8 @@ class OpenModal extends React.Component {
|
|||
if(this.state.activeRequest) {
|
||||
this.state.activeRequest.abort();
|
||||
this.setState({
|
||||
activeRequest: null
|
||||
activeRequest: null,
|
||||
activeRequestUrl: null
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -75,12 +76,15 @@ class OpenModal extends React.Component {
|
|||
onStyleSelect(styleUrl) {
|
||||
this.clearError();
|
||||
|
||||
const activeRequest = request({
|
||||
const reqOpts = {
|
||||
url: styleUrl,
|
||||
withCredentials: false,
|
||||
}, (error, response, body) => {
|
||||
}
|
||||
|
||||
const activeRequest = request(reqOpts, (error, response, body) => {
|
||||
this.setState({
|
||||
activeRequest: null
|
||||
activeRequest: null,
|
||||
activeRequestUrl: null
|
||||
});
|
||||
|
||||
if (!error && response.statusCode == 200) {
|
||||
|
@ -94,7 +98,8 @@ class OpenModal extends React.Component {
|
|||
})
|
||||
|
||||
this.setState({
|
||||
activeRequest: activeRequest
|
||||
activeRequest: activeRequest,
|
||||
activeRequestUrl: reqOpts.url
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -198,9 +203,9 @@ class OpenModal extends React.Component {
|
|||
onOpenToggle={() => this.onCancelActiveRequest()}
|
||||
>
|
||||
<p>
|
||||
Loading...
|
||||
Loading: {this.state.activeRequestUrl}
|
||||
</p>
|
||||
<p>
|
||||
<p className="maputnik-dialog__buttons">
|
||||
<Button onClick={(e) => this.onCancelActiveRequest(e)}>
|
||||
Cancel
|
||||
</Button>
|
||||
|
|
|
@ -135,3 +135,9 @@
|
|||
color: $color-red;
|
||||
}
|
||||
}
|
||||
|
||||
.maputnik-dialog {
|
||||
&__buttons {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue