@unitedstatespowersquadrons/components 1.0.13 → 1.1.0-pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseActionButton.tsx +8 -14
- package/package.json +1 -1
package/BaseActionButton.tsx
CHANGED
|
@@ -99,24 +99,18 @@ const BaseActionButton = (props: BaseActionButtonProps) => {
|
|
|
99
99
|
} else if ("href" in props) {
|
|
100
100
|
const { href, newTab } = props;
|
|
101
101
|
|
|
102
|
-
const onClick = () => {
|
|
103
|
-
if (newTab) {
|
|
104
|
-
open(href, "_blank");
|
|
105
|
-
} else {
|
|
106
|
-
location.href = href;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
102
|
return(
|
|
111
|
-
<
|
|
112
|
-
|
|
103
|
+
<a
|
|
104
|
+
href={href}
|
|
113
105
|
id={id}
|
|
114
|
-
|
|
106
|
+
rel={newTab ? "noreferrer" : undefined}
|
|
107
|
+
target={newTab ? "_blank" : undefined}
|
|
115
108
|
title={title}
|
|
116
|
-
type="button"
|
|
117
109
|
>
|
|
118
|
-
{
|
|
119
|
-
|
|
110
|
+
<button className={classNames("action-button", classes.button, className)} type="button">
|
|
111
|
+
{children}
|
|
112
|
+
</button>
|
|
113
|
+
</a>
|
|
120
114
|
);
|
|
121
115
|
} else {
|
|
122
116
|
throw new Error("Invalid BaseActionButton configuration: must specify props: onClick | (href & method?)");
|