diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-12-01 03:58:05 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-12-01 03:58:05 +0800 |
commit | ea11e8c62dac9ff6352bc983efc707d855b8e881 (patch) | |
tree | cdfc9ad01c2a4e56c560809cb7e01895987ef442 /packages/instant/src/components/standard_panel_content.tsx | |
parent | 7479a7db58f5504416a88450c92b092899bf3df3 (diff) | |
parent | a1d4aa66bc6b3de041ec6e4eb4fe40383945510b (diff) | |
download | dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.gz dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.bz2 dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.lz dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.xz dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.zst dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into fix/instant/instant-bounces-on-error
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> |