1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-12-26 00:21:36 +01:00

Expend library with the ResetWifiSettings function

Use named export instead of the default for ResetWifiSettings,
as we want to use it not only inside the WiFiSettings component.
This commit is contained in:
Aleksandr Gumroian 2021-04-29 10:23:37 +02:00
parent 6059ce9e7b
commit 764a6c86cd
No known key found for this signature in database
GPG Key ID: 9E77849C64F0A733
4 changed files with 11 additions and 11 deletions

View File

@ -20,7 +20,7 @@ ResetWiFiSettings.propTypes = {
endpoint: PropTypes.string.isRequired,
};
export default function ResetWiFiSettings({ ws, endpoint }) {
export function ResetWiFiSettings({ ws, endpoint }) {
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
@ -54,14 +54,13 @@ export default function ResetWiFiSettings({ ws, endpoint }) {
<div className={formFieldsSize}>
<h2>{_("Reset Wi-Fi Settings")}</h2>
<p>
{_(`
If a number of wireless cards doesn't match, you may try to reset the Wi-Fi settings. Note that this will remove the
current Wi-Fi configuration and restore the default values.
`)}
{_(`If a number of wireless cards doesn't match, you may try \
to reset the Wi-Fi settings. Note that this will remove the current Wi-Fi \
configuration and restore the default values.`)}
</p>
<div className="text-right">
<Button
className="btn-warning"
className="btn-primary"
forisFormSize
loading={isLoading}
disabled={isLoading}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
* Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/)
*
* This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information.
@ -10,7 +10,7 @@ import PropTypes from "prop-types";
import { ForisForm } from "../../form/components/ForisForm";
import WiFiForm from "./WiFiForm";
import ResetWiFiSettings from "./ResetWiFiSettings";
import { ResetWiFiSettings } from "./ResetWiFiSettings";
WiFiSettings.propTypes = {
ws: PropTypes.object.isRequired,

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
* Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/)
*
* This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information.
@ -14,7 +14,7 @@ import { mockJSONError } from "testUtils/network";
import { mockSetAlert } from "testUtils/alertContextMock";
import { ALERT_TYPES } from "../../../bootstrap/Alert";
import ResetWiFiSettings from "../ResetWiFiSettings";
import { ResetWiFiSettings } from "../ResetWiFiSettings";
describe("<ResetWiFiSettings/>", () => {
const webSockets = new WebSockets();

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
* Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/)
*
* This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information.
@ -39,6 +39,7 @@ export { Modal, ModalBody, ModalFooter, ModalHeader } from "./bootstrap/Modal";
// Common
export { RebootButton } from "./common/RebootButton";
export { WiFiSettings } from "./common/WiFiSettings/WiFiSettings";
export { ResetWiFiSettings } from "./common/WiFiSettings/ResetWiFiSettings";
// Form
export { ForisForm } from "./form/components/ForisForm";
export {