diff --git a/src/common/WiFiSettings/WiFiForm.js b/src/common/WiFiSettings/WiFiForm.js
index 7950ba6..6005d6b 100644
--- a/src/common/WiFiSettings/WiFiForm.js
+++ b/src/common/WiFiSettings/WiFiForm.js
@@ -7,7 +7,7 @@
import React from "react";
import PropTypes from "prop-types";
-
+import { Switch } from "../../bootstrap/Switch";
import { CheckBox } from "../../bootstrap/CheckBox";
import { PasswordInput } from "../../bootstrap/PasswordInput";
import { RadioSet } from "../../bootstrap/RadioSet";
@@ -18,25 +18,25 @@ import WifiGuestForm from "./WiFiGuestForm";
import { HELP_TEXTS, HTMODES, HWMODES } from "./constants";
WiFiForm.propTypes = {
- formData: PropTypes.shape(
- { devices: PropTypes.arrayOf(PropTypes.object) },
- ).isRequired,
- formErrors: PropTypes.oneOfType([
- PropTypes.object,
- PropTypes.array,
- ]),
+ formData: PropTypes.shape({ devices: PropTypes.arrayOf(PropTypes.object) })
+ .isRequired,
+ formErrors: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
setFormValue: PropTypes.func.isRequired,
hasGuestNetwork: PropTypes.bool,
};
WiFiForm.defaultProps = {
formData: { devices: [] },
- setFormValue: () => { },
+ setFormValue: () => {},
hasGuestNetwork: true,
};
export default function WiFiForm({
- formData, formErrors, setFormValue, hasGuestNetwork, disabled,
+ formData,
+ formErrors,
+ setFormValue,
+ hasGuestNetwork,
+ disabled,
}) {
return formData.devices.map((device, index) => (
));
}
@@ -67,6 +68,7 @@ DeviceForm.propTypes = {
setFormValue: PropTypes.func.isRequired,
hasGuestNetwork: PropTypes.bool,
deviceIndex: PropTypes.number,
+ divider: PropTypes.bool,
};
DeviceForm.defaultProps = {
@@ -75,144 +77,135 @@ DeviceForm.defaultProps = {
};
function DeviceForm({
- formData, formErrors, setFormValue, hasGuestNetwork, deviceIndex, ...props
+ formData,
+ formErrors,
+ setFormValue,
+ hasGuestNetwork,
+ deviceIndex,
+ divider,
+ ...props
}) {
const deviceID = formData.id;
return (
<>
-
{_(`Wi-Fi ${deviceID + 1}`)}
- {_(`Wi-Fi ${deviceID + 1}`)}}
checked={formData.enabled}
-
- onChange={setFormValue(
- (value) => ({ devices: { [deviceIndex]: { enabled: { $set: value } } } }),
- )}
-
+ onChange={setFormValue((value) => ({
+ devices: {
+ [deviceIndex]: { enabled: { $set: value } },
+ },
+ }))}
+ switchHeading
{...props}
/>
- {formData.enabled
- ? (
- <>
- ({
- devices: {
- [deviceIndex]: {
- SSID: { $set: value },
- },
- },
- }),
- )}
-
- {...props}
- >
-
-
-
-
-
- (
- { devices: { [deviceIndex]: { password: { $set: value } } } }
- ),
- )}
-
- {...props}
- />
-
- (
- { devices: { [deviceIndex]: { hidden: { $set: value } } } }
- ),
- )}
-
- {...props}
- />
-
- ({
- devices: {
- [deviceIndex]: {
- hwmode: { $set: value },
- channel: { $set: "0" },
- },
- },
- }),
- )}
-
- {...props}
- />
-
-