From 0e7329bcecb893b34b3f4199ba653748f55d852b Mon Sep 17 00:00:00 2001 From: Ezekiel Aquino Date: Thu, 29 Nov 2018 14:36:35 +0100 Subject: Tweaks button --- packages/website/ts/@next/components/button.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/@next/components/button.tsx b/packages/website/ts/@next/components/button.tsx index 07d598cba..9cadc4fd5 100644 --- a/packages/website/ts/@next/components/button.tsx +++ b/packages/website/ts/@next/components/button.tsx @@ -46,10 +46,9 @@ const Text = styled.span` export const Button: React.StatelessComponent = props => { const { onClick, href } = props; + const Component = onClick ? StyledButton : StyledButton.withComponent('a'); - // This button is as link - if (props.href) return StyledButton.withComponent('a'); - else return StyledButton; + return { props.children || 'Text' }; }; @@ -60,11 +59,11 @@ export const Button: React.StatelessComponent = props => { -export const Button: React.StatelessComponent = ({ ...props }) => ( - - {props.text} - -); +// export const Button: React.StatelessComponent = ({ ...props }) => ( +// +// {props.text} +// +// ); // also feel like a transparent prop would suffice instead of having a separate button // so we have the logic with the Link/button--- and props = styling. in this case: -- cgit