Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-smush.../_src/react/common
File: button.js
import React from "react";
[0] Fix | Delete
import classnames from "classnames";
[1] Fix | Delete
[2] Fix | Delete
export default function Button(
[3] Fix | Delete
{
[4] Fix | Delete
id = "",
[5] Fix | Delete
text = "",
[6] Fix | Delete
color = "",
[7] Fix | Delete
dashed = false,
[8] Fix | Delete
icon = '',
[9] Fix | Delete
loading = false,
[10] Fix | Delete
ghost = false,
[11] Fix | Delete
disabled = false,
[12] Fix | Delete
href = "",
[13] Fix | Delete
target = "",
[14] Fix | Delete
className = "",
[15] Fix | Delete
onClick = () => false,
[16] Fix | Delete
}
[17] Fix | Delete
) {
[18] Fix | Delete
function handleClick(e) {
[19] Fix | Delete
e.preventDefault();
[20] Fix | Delete
[21] Fix | Delete
onClick();
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
function textTag() {
[25] Fix | Delete
const iconTag = icon ? <span className={icon} aria-hidden="true"/> : "";
[26] Fix | Delete
return (
[27] Fix | Delete
<span className={classnames({"sui-loading-text": loading})}>
[28] Fix | Delete
{iconTag} {text}
[29] Fix | Delete
</span>
[30] Fix | Delete
);
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
function loadingIcon() {
[34] Fix | Delete
return loading
[35] Fix | Delete
? <span className="sui-icon-loader sui-loading" aria-hidden="true"/>
[36] Fix | Delete
: "";
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
let HtmlTag, props;
[40] Fix | Delete
if (href) {
[41] Fix | Delete
HtmlTag = 'a';
[42] Fix | Delete
props = {href: href, target: target};
[43] Fix | Delete
} else {
[44] Fix | Delete
HtmlTag = 'button';
[45] Fix | Delete
props = {
[46] Fix | Delete
disabled: disabled,
[47] Fix | Delete
onClick: e => handleClick(e)
[48] Fix | Delete
};
[49] Fix | Delete
}
[50] Fix | Delete
const hasText = text && text.trim();
[51] Fix | Delete
[52] Fix | Delete
return (
[53] Fix | Delete
<HtmlTag
[54] Fix | Delete
{...props}
[55] Fix | Delete
className={classnames(className, "sui-button-" + color, {
[56] Fix | Delete
"sui-button-onload": loading,
[57] Fix | Delete
"sui-button-ghost": ghost,
[58] Fix | Delete
"sui-button-icon": !hasText,
[59] Fix | Delete
"sui-button-dashed": dashed,
[60] Fix | Delete
"sui-button": hasText
[61] Fix | Delete
})}
[62] Fix | Delete
id={id}
[63] Fix | Delete
>
[64] Fix | Delete
{textTag()}
[65] Fix | Delete
{loadingIcon()}
[66] Fix | Delete
</HtmlTag>
[67] Fix | Delete
);
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function