Added dialog styling.

This commit is contained in:
orangemug 2018-06-18 18:17:33 +01:00
parent 7167235146
commit 558f3d649d
2 changed files with 18 additions and 7 deletions

View file

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

View file

@ -135,3 +135,9 @@
color: $color-red;
}
}
.maputnik-dialog {
&__buttons {
text-align: right;
}
}