diff options
author | Francesco Agosti <francesco.agosti93@gmail.com> | 2018-11-14 09:31:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-14 09:31:38 +0800 |
commit | 4fc457b78b30e761164eac26fe5f1ebcddd11f7d (patch) | |
tree | 05a0d01029815d36370f8548d365289f555e8be4 /packages/instant/src/components/ui/text.tsx | |
parent | e02dc13805349a770506350c69e9061f596b48b2 (diff) | |
parent | 2f6b1273aaf621beebcbc70af4bb6c5f4a8217a3 (diff) | |
download | dexon-0x-contracts-4fc457b78b30e761164eac26fe5f1ebcddd11f7d.tar.gz dexon-0x-contracts-4fc457b78b30e761164eac26fe5f1ebcddd11f7d.tar.zst dexon-0x-contracts-4fc457b78b30e761164eac26fe5f1ebcddd11f7d.zip |
Merge pull request #1242 from 0xProject/feature/instant/metamask-connect-flow
[instant] Install/Unlock MetaMask, connect PaymentDropdown to redux state
Diffstat (limited to 'packages/instant/src/components/ui/text.tsx')
-rw-r--r-- | packages/instant/src/components/ui/text.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/instant/src/components/ui/text.tsx b/packages/instant/src/components/ui/text.tsx index 4fe429d25..fd14cc4d1 100644 --- a/packages/instant/src/components/ui/text.tsx +++ b/packages/instant/src/components/ui/text.tsx @@ -2,6 +2,7 @@ import { darken } from 'polished'; import * as React from 'react'; import { ColorOption, styled } from '../../style/theme'; +import { util } from '../../util/util'; export interface TextProps { fontColor?: ColorOption; @@ -20,10 +21,16 @@ export interface TextProps { onClick?: (event: React.MouseEvent<HTMLElement>) => void; noWrap?: boolean; display?: string; + href?: string; } +export const Text: React.StatelessComponent<TextProps> = ({ href, onClick, ...rest }) => { + const computedOnClick = href ? util.createOpenUrlInNewWindow(href) : onClick; + return <StyledText {...rest} onClick={computedOnClick} />; +}; + const darkenOnHoverAmount = 0.3; -export const Text = +export const StyledText = styled.div < TextProps > ` |