Disable Connect/Disconnect buttons when not in use
This commit is contained in:
parent
efd71d6989
commit
19d4d2c426
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
import electron from "electron";
|
import electron from "electron";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { Dialog, DialogType, DialogFooter } from "@fluentui/react/lib/Dialog";
|
import { Dialog, DialogType, DialogFooter } from "@fluentui/react/lib/Dialog";
|
||||||
import { PrimaryButton, DefaultButton } from "@fluentui/react/lib/Button";
|
import { DefaultButton } from "@fluentui/react/lib/Button";
|
||||||
import { ThemeProvider, PartialTheme } from "@fluentui/react/lib/Theme";
|
import { ThemeProvider, PartialTheme } from "@fluentui/react/lib/Theme";
|
||||||
import { ComboBox, IComboBoxOption } from "@fluentui/react/lib/ComboBox";
|
import { ComboBox, IComboBoxOption } from "@fluentui/react/lib/ComboBox";
|
||||||
import SerialPort from "serialport";
|
import SerialPort from "serialport";
|
||||||
|
@ -92,8 +92,8 @@ const Settings: React.FC<Proptypes> = () => {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<PrimaryButton onClick={() => { dispatch(connect()); }} text="Connect" />
|
<DefaultButton primary disabled={selector.serialConnection.status.connected} onClick={() => { dispatch(connect()); }} text="Connect" />
|
||||||
<DefaultButton onClick={() => { dispatch(disconnect()); }} text="Disconnect" />
|
<DefaultButton disabled={!selector.serialConnection.status.connected} onClick={() => { dispatch(disconnect()); }} text="Disconnect" />
|
||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
|
|
Reference in a new issue