diff options
author | Steve Klebanoff <steve@0xproject.com> | 2018-11-29 06:01:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-29 06:01:07 +0800 |
commit | e5b09ba2fd366e485a864bc5819ebde5338f166c (patch) | |
tree | d2c7e80d7a71bab5d311a111dc7490dc6863c0e1 /packages/instant/src/components/standard_panel_content.tsx | |
parent | 53f8e1b3b426424bf4459605b48e706eb7fb6d90 (diff) | |
parent | b95d73d176db7df99381a25270e98d5bcf954707 (diff) | |
download | dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.tar.gz dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.tar.zst dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.zip |
Merge pull request #1341 from 0xProject/feature/instant/install-analytics
[instant] Install Wallet analytic events
Diffstat (limited to 'packages/instant/src/components/standard_panel_content.tsx')
-rw-r--r-- | packages/instant/src/components/standard_panel_content.tsx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/instant/src/components/standard_panel_content.tsx b/packages/instant/src/components/standard_panel_content.tsx index 582b3318e..79b7bff24 100644 --- a/packages/instant/src/components/standard_panel_content.tsx +++ b/packages/instant/src/components/standard_panel_content.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { ColorOption } from '../style/theme'; +import { util } from '../util/util'; import { Container } from './ui/container'; import { Flex } from './ui/flex'; @@ -9,6 +10,7 @@ import { Text } from './ui/text'; export interface MoreInfoSettings { text: string; href: string; + onClick?: () => void; } export interface StandardPanelContentProps { @@ -21,6 +23,15 @@ export interface StandardPanelContentProps { const SPACING_BETWEEN_PX = '20px'; +const onMoreInfoClick = (href: string, onClick?: () => void) => { + return () => { + if (onClick) { + onClick(); + } + util.createOpenUrlInNewWindow(href)(); + }; +}; + export const StandardPanelContent: React.StatelessComponent<StandardPanelContentProps> = ({ image, title, @@ -50,7 +61,7 @@ export const StandardPanelContent: React.StatelessComponent<StandardPanelContent fontSize="13px" textDecorationLine="underline" fontColor={ColorOption.lightGrey} - href={moreInfoSettings.href} + onClick={onMoreInfoClick(moreInfoSettings.href, moreInfoSettings.onClick)} > {moreInfoSettings.text} </Text> |