diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-13 09:48:13 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-13 09:48:13 +0800 |
commit | 2b4dcb419e50cee84b4e4296b9328669c1bec626 (patch) | |
tree | fb12049af32bd0ec8d16727efd564f0a49d041b5 /packages/instant | |
parent | c67632dff5d6f16f303c12f1595af1b813d1402c (diff) | |
download | dexon-sol-tools-2b4dcb419e50cee84b4e4296b9328669c1bec626.tar dexon-sol-tools-2b4dcb419e50cee84b4e4296b9328669c1bec626.tar.gz dexon-sol-tools-2b4dcb419e50cee84b4e4296b9328669c1bec626.tar.bz2 dexon-sol-tools-2b4dcb419e50cee84b4e4296b9328669c1bec626.tar.lz dexon-sol-tools-2b4dcb419e50cee84b4e4296b9328669c1bec626.tar.xz dexon-sol-tools-2b4dcb419e50cee84b4e4296b9328669c1bec626.tar.zst dexon-sol-tools-2b4dcb419e50cee84b4e4296b9328669c1bec626.zip |
fix: rename handler creator name
Diffstat (limited to 'packages/instant')
-rw-r--r-- | packages/instant/src/components/ui/button.tsx | 2 | ||||
-rw-r--r-- | packages/instant/src/components/ui/text.tsx | 2 | ||||
-rw-r--r-- | packages/instant/src/util/util.ts | 2 |
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'), }; |