dashboard: action buttons use the swarm UI's button, with its danger tone and touch height
Button.css moves to @hive/shared, a rename from swarm-ui/src/ui/button/Button.css to shared/src/button/Button.css; the swarm UI's Button imports it from there and the dashboard imports it too. The dashboard's own .btn rules and its eleven per-action colour modifiers are gone: the bulk action buttons, the per-row purge and the selection bar's clear are ui-button, destroy and purge are ui-button-danger, and all of them have the 2.75em height the dashboard buttons were under. The form() and addBulkButton helpers take a tone (danger or default) in place of a btn-* class. The danger variant is the one the confirmations PR adds, identical, so the two merge in either order.
This commit is contained in:
parent
94dd24fa99
commit
16a5bff2b1
1 changed files with 26 additions and 140 deletions
|
|
@ -22,9 +22,17 @@ export const esc = (s) =>
|
|||
(c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c],
|
||||
);
|
||||
|
||||
// An action button in the swarm UI's look (`@hive/shared/button.css`): the tone
|
||||
// is `"danger"` for an action that destroys, `"default"` for the rest. Any other
|
||||
// string is taken as the button's own classes, for the one pill-shaped control.
|
||||
export const buttonClass = (tone) =>
|
||||
tone === "danger" || tone === "default"
|
||||
? "ui-button ui-button-" + tone
|
||||
: tone;
|
||||
|
||||
export const form = (
|
||||
action,
|
||||
btnClass,
|
||||
tone,
|
||||
btnLabel,
|
||||
confirmMsg,
|
||||
extra = {},
|
||||
|
|
@ -45,7 +53,7 @@ export const form = (
|
|||
f.append(el("input", { type: "hidden", name, value }));
|
||||
}
|
||||
f.append(
|
||||
el("button", { type: "submit", class: "btn " + btnClass }, btnLabel),
|
||||
el("button", { type: "submit", class: buttonClass(tone) }, btnLabel),
|
||||
);
|
||||
return f;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue