mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Replacing icon property when icon has been requested.
Creating <APIButton/> which handles success/failure/pending during API calls.
This commit is contained in:
parent
237b429cbf
commit
59c4ab2502
24 changed files with 483 additions and 334 deletions
|
|
@ -3,7 +3,7 @@ import {getSettings, saveSettings} from "../../api";
|
|||
import {Button, Form, FormGroup, FormInput, Header, Loader, Modal, ModalContent, ModalHeader, Segment} from "../Theme";
|
||||
import {Container, Dimmer, Icon} from "semantic-ui-react";
|
||||
import {ThemeContext} from "../../contexts/contexts";
|
||||
import {HelpPopup, HotspotToggle, ThrottleToggle, Toggle, WROLModeMessage} from "../Common";
|
||||
import {APIButton, HelpPopup, HotspotToggle, ThrottleToggle, Toggle, WROLModeMessage} from "../Common";
|
||||
import QRCode from "react-qr-code";
|
||||
|
||||
export class Settings extends React.Component {
|
||||
|
|
@ -57,7 +57,9 @@ export class Settings extends React.Component {
|
|||
}
|
||||
|
||||
async handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
this.setState({disabled: true, pending: true});
|
||||
let settings = {
|
||||
download_on_startup: this.state.download_on_startup,
|
||||
|
|
@ -228,9 +230,13 @@ export class Settings extends React.Component {
|
|||
|
||||
<br/>
|
||||
|
||||
<Button color='violet' type="submit" disabled={disabled} size='large'>
|
||||
Save
|
||||
</Button>
|
||||
<APIButton
|
||||
color='violet'
|
||||
size='big'
|
||||
onClick={this.handleSubmit}
|
||||
obeyWROLMode={true}
|
||||
disabled={disabled}
|
||||
>Save</APIButton>
|
||||
|
||||
<Dimmer active={pending}>
|
||||
<Loader active={pending} size='large'/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue