diff --git a/src/bootstrap/Button.js b/src/bootstrap/Button.js index 84ad558..84895f5 100644 --- a/src/bootstrap/Button.js +++ b/src/bootstrap/Button.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) + * Copyright (C) 2019-2023 CZ.NIC z.s.p.o. (https://www.nic.cz/) * * This is free software, licensed under the GNU General Public License v3. * See /LICENSE for more information. @@ -31,24 +31,25 @@ export function Button({ children, ...props }) { - let buttonClass = className ? `btn ${className}` : "btn btn-primary "; + let buttonClass = className ? `btn ${className}` : "btn btn-primary"; if (forisFormSize) { buttonClass = `${buttonClass} col-sm-12 col-md-3 col-lg-2`; } - const span = loading ? ( - - ) : null; - return ( - - {span} - {span ? " " : null} - {children} + + {loading && ( + + )} + {children} ); } diff --git a/src/bootstrap/Spinner.css b/src/bootstrap/Spinner.css index 59fece3..2e68e26 100644 --- a/src/bootstrap/Spinner.css +++ b/src/bootstrap/Spinner.css @@ -31,3 +31,7 @@ .spinner-fs-wrapper .spinner-text { margin: 1rem; } + +.spinner-border-sm { + min-width: 16px; +} diff --git a/src/bootstrap/__tests__/__snapshots__/Button.test.js.snap b/src/bootstrap/__tests__/__snapshots__/Button.test.js.snap index db9351b..4deeb21 100644 --- a/src/bootstrap/__tests__/__snapshots__/Button.test.js.snap +++ b/src/bootstrap/__tests__/__snapshots__/Button.test.js.snap @@ -2,33 +2,38 @@ exports[` Render button correctly 1`] = ` - Test Button + + Test Button + `; exports[` Render button with custom classes 1`] = ` - Test Button + + Test Button + `; exports[` Render button with spinner 1`] = ` - - Test Button + + Test Button + `; diff --git a/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap b/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap index d66d559..2fb26c8 100644 --- a/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap +++ b/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap @@ -301,10 +301,12 @@ exports[` Snapshot both modules disabled. 1`] = ` class="text-right" > - Save + + Save + @@ -322,10 +324,12 @@ exports[` Snapshot both modules disabled. 1`] = ` class="text-right" > - Reset Wi-Fi Settings + + Reset Wi-Fi Settings + @@ -435,13 +439,13 @@ exports[` Snapshot guest network. 1`] = ` class=\\"text-right\\" > - Save - - " + + Save + " `; exports[` Snapshot one module enabled. 1`] = ` diff --git a/src/common/__tests__/__snapshots__/RebootButton.test.js.snap b/src/common/__tests__/__snapshots__/RebootButton.test.js.snap index 1a2ced3..8bddfea 100644 --- a/src/common/__tests__/__snapshots__/RebootButton.test.js.snap +++ b/src/common/__tests__/__snapshots__/RebootButton.test.js.snap @@ -46,16 +46,20 @@ exports[` Render modal. 1`] = ` class="modal-footer" > - Cancel + + Cancel + - Confirm reboot + + Confirm reboot + @@ -63,10 +67,12 @@ exports[` Render modal. 1`] = ` - Reboot + + Reboot + `; @@ -77,10 +83,12 @@ exports[` Render. 1`] = ` id="modal-container" /> - Reboot + + Reboot + `; diff --git a/src/form/__tests__/__snapshots__/SubmitButton.test.js.snap b/src/form/__tests__/__snapshots__/SubmitButton.test.js.snap index c9667b5..6385cf6 100644 --- a/src/form/__tests__/__snapshots__/SubmitButton.test.js.snap +++ b/src/form/__tests__/__snapshots__/SubmitButton.test.js.snap @@ -3,17 +3,18 @@ exports[` Render load 1`] = ` - - Load settings + + Load settings + `; @@ -21,10 +22,12 @@ exports[` Render load 1`] = ` exports[` Render ready 1`] = ` - Save + + Save + `; @@ -32,17 +35,18 @@ exports[` Render ready 1`] = ` exports[` Render saving 1`] = ` - - Updating + + Updating + `;