mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-11-14 17:35:35 +01:00
Compare commits
No commits in common. "80619fab3c519d4a4b7a9f886e62550489d6c489" and "9c3dcaf6b54a8d520e1fd1582c8902487cf22c8b" have entirely different histories.
80619fab3c
...
9c3dcaf6b5
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2019-2023 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
|
||||||
*
|
*
|
||||||
* This is free software, licensed under the GNU General Public License v3.
|
* This is free software, licensed under the GNU General Public License v3.
|
||||||
* See /LICENSE for more information.
|
* See /LICENSE for more information.
|
||||||
|
@ -31,25 +31,24 @@ export function Button({
|
||||||
children,
|
children,
|
||||||
...props
|
...props
|
||||||
}) {
|
}) {
|
||||||
let buttonClass = className ? `btn ${className}` : "btn btn-primary";
|
let buttonClass = className ? `btn ${className}` : "btn btn-primary ";
|
||||||
if (forisFormSize) {
|
if (forisFormSize) {
|
||||||
buttonClass = `${buttonClass} col-sm-12 col-md-3 col-lg-2`;
|
buttonClass = `${buttonClass} col-sm-12 col-md-3 col-lg-2`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
const span = loading ? (
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className={`${buttonClass} d-inline-flex justify-content-center align-items-center`}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
{loading && (
|
|
||||||
<span
|
<span
|
||||||
className="spinner-border spinner-border-sm mr-1"
|
className="spinner-border spinner-border-sm"
|
||||||
role="status"
|
role="status"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
/>
|
/>
|
||||||
)}
|
) : null;
|
||||||
<span>{children}</span>
|
|
||||||
|
return (
|
||||||
|
<button type="button" className={buttonClass} {...props}>
|
||||||
|
{span}
|
||||||
|
{span ? " " : null}
|
||||||
|
{children}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,3 @@
|
||||||
.spinner-fs-wrapper .spinner-text {
|
.spinner-fs-wrapper .spinner-text {
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spinner-border-sm {
|
|
||||||
min-width: 16px;
|
|
||||||
}
|
|
||||||
|
|
|
@ -2,38 +2,33 @@
|
||||||
|
|
||||||
exports[`<Button /> Render button correctly 1`] = `
|
exports[`<Button /> Render button correctly 1`] = `
|
||||||
<button
|
<button
|
||||||
class="btn btn-primary d-inline-flex justify-content-center align-items-center"
|
class="btn btn-primary "
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Test Button
|
Test Button
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`<Button /> Render button with custom classes 1`] = `
|
exports[`<Button /> Render button with custom classes 1`] = `
|
||||||
<button
|
<button
|
||||||
class="btn one two three d-inline-flex justify-content-center align-items-center"
|
class="btn one two three"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Test Button
|
Test Button
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`<Button /> Render button with spinner 1`] = `
|
exports[`<Button /> Render button with spinner 1`] = `
|
||||||
<button
|
<button
|
||||||
class="btn btn-primary d-inline-flex justify-content-center align-items-center"
|
class="btn btn-primary "
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="spinner-border spinner-border-sm mr-1"
|
class="spinner-border spinner-border-sm"
|
||||||
role="status"
|
role="status"
|
||||||
/>
|
/>
|
||||||
<span>
|
|
||||||
Test Button
|
Test Button
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -301,12 +301,10 @@ exports[`<WiFiSettings/> Snapshot both modules disabled. 1`] = `
|
||||||
class="text-right"
|
class="text-right"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="btn btn-primary col-sm-12 col-md-3 col-lg-2 d-inline-flex justify-content-center align-items-center"
|
class="btn btn-primary col-sm-12 col-md-3 col-lg-2"
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Save
|
Save
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -324,12 +322,10 @@ exports[`<WiFiSettings/> Snapshot both modules disabled. 1`] = `
|
||||||
class="text-right"
|
class="text-right"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="btn btn-primary col-sm-12 col-md-3 col-lg-2 d-inline-flex justify-content-center align-items-center"
|
class="btn btn-primary col-sm-12 col-md-3 col-lg-2"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Reset Wi-Fi Settings
|
Reset Wi-Fi Settings
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -439,13 +435,13 @@ exports[`<WiFiSettings/> Snapshot guest network. 1`] = `
|
||||||
class=\\"text-right\\"
|
class=\\"text-right\\"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class=\\"btn btn-primary col-sm-12 col-md-3 col-lg-2 d-inline-flex justify-content-center align-items-center\\"
|
class=\\"btn btn-primary col-sm-12 col-md-3 col-lg-2\\"
|
||||||
+ disabled=\\"\\"
|
+ disabled=\\"\\"
|
||||||
type=\\"submit\\"
|
type=\\"submit\\"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Save
|
Save
|
||||||
</span>"
|
</button>
|
||||||
|
</div>"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
|
exports[`<WiFiSettings/> Snapshot one module enabled. 1`] = `
|
||||||
|
|
|
@ -46,20 +46,16 @@ exports[`<RebootButton/> Render modal. 1`] = `
|
||||||
class="modal-footer"
|
class="modal-footer"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="btn btn-primary d-inline-flex justify-content-center align-items-center"
|
class="btn btn-primary "
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Cancel
|
Cancel
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-danger d-inline-flex justify-content-center align-items-center"
|
class="btn btn-danger"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Confirm reboot
|
Confirm reboot
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,12 +63,10 @@ exports[`<RebootButton/> Render modal. 1`] = `
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="btn btn-danger d-inline-flex justify-content-center align-items-center"
|
class="btn btn-danger"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Reboot
|
Reboot
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -83,12 +77,10 @@ exports[`<RebootButton/> Render. 1`] = `
|
||||||
id="modal-container"
|
id="modal-container"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class="btn btn-danger d-inline-flex justify-content-center align-items-center"
|
class="btn btn-danger"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Reboot
|
Reboot
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -3,18 +3,17 @@
|
||||||
exports[`<SubmitButton/> Render load 1`] = `
|
exports[`<SubmitButton/> Render load 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="btn btn-primary col-sm-12 col-md-3 col-lg-2 d-inline-flex justify-content-center align-items-center"
|
class="btn btn-primary col-sm-12 col-md-3 col-lg-2"
|
||||||
disabled=""
|
disabled=""
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="spinner-border spinner-border-sm mr-1"
|
class="spinner-border spinner-border-sm"
|
||||||
role="status"
|
role="status"
|
||||||
/>
|
/>
|
||||||
<span>
|
|
||||||
Load settings
|
Load settings
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -22,12 +21,10 @@ exports[`<SubmitButton/> Render load 1`] = `
|
||||||
exports[`<SubmitButton/> Render ready 1`] = `
|
exports[`<SubmitButton/> Render ready 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="btn btn-primary col-sm-12 col-md-3 col-lg-2 d-inline-flex justify-content-center align-items-center"
|
class="btn btn-primary col-sm-12 col-md-3 col-lg-2"
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
<span>
|
|
||||||
Save
|
Save
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -35,18 +32,17 @@ exports[`<SubmitButton/> Render ready 1`] = `
|
||||||
exports[`<SubmitButton/> Render saving 1`] = `
|
exports[`<SubmitButton/> Render saving 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="btn btn-primary col-sm-12 col-md-3 col-lg-2 d-inline-flex justify-content-center align-items-center"
|
class="btn btn-primary col-sm-12 col-md-3 col-lg-2"
|
||||||
disabled=""
|
disabled=""
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="spinner-border spinner-border-sm mr-1"
|
class="spinner-border spinner-border-sm"
|
||||||
role="status"
|
role="status"
|
||||||
/>
|
/>
|
||||||
<span>
|
|
||||||
Updating
|
Updating
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user