From 433fb3597dc19cb223a2b8d0e373502042241abb Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 9 Nov 2018 15:26:57 -0800 Subject: feat: refactor button styles and add href to Text --- packages/instant/src/components/buy_button.tsx | 2 +- .../src/components/standard_panel_content.tsx | 21 ++++++++++----------- packages/instant/src/components/ui/button.tsx | 11 ++++------- packages/instant/src/components/ui/text.tsx | 9 ++++++++- packages/instant/src/util/util.ts | 1 + 5 files changed, 24 insertions(+), 20 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index 877ab275c..c10e07b83 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -43,7 +43,7 @@ export class BuyButton extends React.Component { onClick={this._handleClick} isDisabled={shouldDisableButton} fontColor={ColorOption.white} - fontSize="20px" + fontSize="16px" > Buy diff --git a/packages/instant/src/components/standard_panel_content.tsx b/packages/instant/src/components/standard_panel_content.tsx index fca5383ea..95a79bd55 100644 --- a/packages/instant/src/components/standard_panel_content.tsx +++ b/packages/instant/src/components/standard_panel_content.tsx @@ -29,7 +29,7 @@ export const StandardPanelContent: React.StatelessComponent ( - + {image} @@ -43,16 +43,15 @@ export const StandardPanelContent: React.StatelessComponent {moreInfoSettings && ( - - - {moreInfoSettings.text} - - + + {moreInfoSettings.text} + )} diff --git a/packages/instant/src/components/ui/button.tsx b/packages/instant/src/components/ui/button.tsx index 479ef6c77..fbc5bcad4 100644 --- a/packages/instant/src/components/ui/button.tsx +++ b/packages/instant/src/components/ui/button.tsx @@ -2,6 +2,7 @@ import { darken, saturate } from 'polished'; import * as React from 'react'; import { ColorOption, styled } from '../../style/theme'; +import { util } from '../../util/util'; export type ButtonOnClickHandler = (event: React.MouseEvent) => void; @@ -19,10 +20,6 @@ export interface ButtonProps { className?: string; } -const createHrefOnClick = (href: string) => () => { - window.open(href, '_blank'); -}; - const PlainButton: React.StatelessComponent = ({ children, isDisabled, @@ -31,7 +28,7 @@ const PlainButton: React.StatelessComponent = ({ type, className, }) => { - const computedOnClick = isDisabled ? undefined : href ? createHrefOnClick(href) : onClick; + const computedOnClick = isDisabled ? undefined : href ? util.createHrefOnClick(href) : onClick; return (