aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/instant/src/components/ui/button.tsx2
-rw-r--r--packages/instant/src/components/ui/text.tsx2
-rw-r--r--packages/instant/src/util/util.ts2
3 files changed, 3 insertions, 3 deletions
diff --git a/packages/instant/src/components/ui/button.tsx b/packages/instant/src/components/ui/button.tsx
index 9b8eaad69..e77b1b5d1 100644
--- a/packages/instant/src/components/ui/button.tsx
+++ b/packages/instant/src/components/ui/button.tsx
@@ -28,7 +28,7 @@ const PlainButton: React.StatelessComponent<ButtonProps> = ({
type,
className,
}) => {
- const computedOnClick = isDisabled ? undefined : href ? util.createHrefOnClick(href) : onClick;
+ const computedOnClick = isDisabled ? undefined : href ? util.createOpenUrlInNewWindow(href) : onClick;
return (
<button type={type} className={className} onClick={computedOnClick} disabled={isDisabled}>
{children}
diff --git a/packages/instant/src/components/ui/text.tsx b/packages/instant/src/components/ui/text.tsx
index 3dba11c74..fd14cc4d1 100644
--- a/packages/instant/src/components/ui/text.tsx
+++ b/packages/instant/src/components/ui/text.tsx
@@ -25,7 +25,7 @@ export interface TextProps {
}
export const Text: React.StatelessComponent<TextProps> = ({ href, onClick, ...rest }) => {
- const computedOnClick = href ? util.createHrefOnClick(href) : onClick;
+ const computedOnClick = href ? util.createOpenUrlInNewWindow(href) : onClick;
return <StyledText {...rest} onClick={computedOnClick} />;
};
diff --git a/packages/instant/src/util/util.ts b/packages/instant/src/util/util.ts
index aeb68956b..29b6b1d2b 100644
--- a/packages/instant/src/util/util.ts
+++ b/packages/instant/src/util/util.ts
@@ -2,5 +2,5 @@ import * as _ from 'lodash';
export const util = {
boundNoop: _.noop.bind(_),
- createHrefOnClick: (href: string) => () => window.open(href, '_blank'),
+ createOpenUrlInNewWindow: (href: string) => () => window.open(href, '_blank'),
};