aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/standard_panel_content.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-12-04 06:48:15 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-12-04 06:48:15 +0800
commit7086bd32ee23f0931be26194eb28af8178f858eb (patch)
tree53764373a8228b00d88939fdecc6f6a1ae633c9e /packages/instant/src/components/standard_panel_content.tsx
parent50bfbda79a312651581f03614c1b4f4cbbe49cf1 (diff)
parent50df67e7511460f051f91785bb4384485077ef60 (diff)
downloaddexon-sol-tools-7086bd32ee23f0931be26194eb28af8178f858eb.tar
dexon-sol-tools-7086bd32ee23f0931be26194eb28af8178f858eb.tar.gz
dexon-sol-tools-7086bd32ee23f0931be26194eb28af8178f858eb.tar.bz2
dexon-sol-tools-7086bd32ee23f0931be26194eb28af8178f858eb.tar.lz
dexon-sol-tools-7086bd32ee23f0931be26194eb28af8178f858eb.tar.xz
dexon-sol-tools-7086bd32ee23f0931be26194eb28af8178f858eb.tar.zst
dexon-sol-tools-7086bd32ee23f0931be26194eb28af8178f858eb.zip
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/website/instant-configurator
Diffstat (limited to 'packages/instant/src/components/standard_panel_content.tsx')
-rw-r--r--packages/instant/src/components/standard_panel_content.tsx13
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>