mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 00:15:44 +01:00
Update Button.tsx
This commit is contained in:
@@ -78,9 +78,6 @@ class Button extends React.Component<Props> {
|
|||||||
children,
|
children,
|
||||||
testId
|
testId
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const loadingClass = loading ? "is-loading" : "";
|
|
||||||
const fullWidthClass = fullWidth ? "is-fullwidth" : "";
|
|
||||||
const reducedMobileClass = reducedMobile ? "is-reduced-mobile" : "";
|
|
||||||
if (icon) {
|
if (icon) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
@@ -88,7 +85,14 @@ class Button extends React.Component<Props> {
|
|||||||
title={title}
|
title={title}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onClick={this.onClick}
|
onClick={this.onClick}
|
||||||
className={classNames("button", "is-" + color, loadingClass, fullWidthClass, reducedMobileClass, className)}
|
className={classNames(
|
||||||
|
"button",
|
||||||
|
"is-" + color,
|
||||||
|
{ "is-loading": loading },
|
||||||
|
{ "is-fullwidth": fullWidth },
|
||||||
|
{ "is-reduced-mobile": reducedMobile },
|
||||||
|
className
|
||||||
|
)}
|
||||||
{...createAttributesForTesting(testId)}
|
{...createAttributesForTesting(testId)}
|
||||||
>
|
>
|
||||||
<span className="icon is-medium">
|
<span className="icon is-medium">
|
||||||
@@ -109,7 +113,13 @@ class Button extends React.Component<Props> {
|
|||||||
title={title}
|
title={title}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onClick={this.onClick}
|
onClick={this.onClick}
|
||||||
className={classNames("button", "is-" + color, loadingClass, fullWidthClass, className)}
|
className={classNames(
|
||||||
|
"button",
|
||||||
|
"is-" + color,
|
||||||
|
{ "is-loading": loading },
|
||||||
|
{ "is-fullwidth": fullWidth },
|
||||||
|
className
|
||||||
|
)}
|
||||||
{...createAttributesForTesting(testId)}
|
{...createAttributesForTesting(testId)}
|
||||||
>
|
>
|
||||||
{label} {children}
|
{label} {children}
|
||||||
|
|||||||
Reference in New Issue
Block a user