From a21bca7cf4771d04879036f3406f38276af93e3a Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Thu, 29 Nov 2018 15:34:26 +0100 Subject: Cleanup button component --- packages/website/ts/@next/components/button.tsx | 26 ++++++------------------- packages/website/ts/@next/components/header.tsx | 2 +- packages/website/ts/@next/pages/landing.tsx | 8 ++++---- 3 files changed, 11 insertions(+), 25 deletions(-) (limited to 'packages') diff --git a/packages/website/ts/@next/components/button.tsx b/packages/website/ts/@next/components/button.tsx index e98388248..390136347 100644 --- a/packages/website/ts/@next/components/button.tsx +++ b/packages/website/ts/@next/components/button.tsx @@ -3,12 +3,10 @@ import styled from 'styled-components'; import { colors } from 'ts/style/colors'; - interface ButtonInterface { - text: string; transparent?: boolean; inline?: boolean; - href?: string, + href?: string; onClick?: () => void; } @@ -16,13 +14,15 @@ const StyledButton = styled.button` appearance: none; border: 0; background-color: ${colors.brandLight}; + border: 1px solid ${colors.brandLight}; color: ${colors.white}; text-align: center; padding: 13px 22px 14px; + text-decoration: none; ${props => props.transparent && ` background-color: transparent; - border: 1px solid #6A6A6A; + border-color: #6A6A6A; `} ${props => props.inline && ` @@ -33,14 +33,6 @@ const StyledButton = styled.button` `} `; -const Text = styled.span` - font-size: 1rem; - font-weight: 500; - line-height: 1.375rem; -`; - - - // A button that may exist as a button or a link // a button only makes sense with an onClick handler // a link with an href so we base the type of component we return @@ -50,17 +42,13 @@ export const Button: React.StatelessComponent = props => { const { onClick, href } = props; const Component = onClick ? StyledButton : StyledButton.withComponent('a'); - return { props.children || 'Text' }; + return {props.children}; }; - // usage // ===> Text // ====> - - - // export const Button: React.StatelessComponent = ({ ...props }) => ( // // {props.text} @@ -71,9 +59,7 @@ export const Button: React.StatelessComponent = props => { // so we have the logic with the Link/button--- and props = styling. in this case: // background-color: ${props => !props.transparent && 'somecolor'}.. export const ButtonTransparent: React.StatelessComponent = ({ ...props }) => ( - - {props.text} - + ); Button.defaultProps = { diff --git a/packages/website/ts/@next/components/header.tsx b/packages/website/ts/@next/components/header.tsx index f9b71a43c..ac37e3ab2 100644 --- a/packages/website/ts/@next/components/header.tsx +++ b/packages/website/ts/@next/components/header.tsx @@ -54,7 +54,7 @@ export const Header: React.StatelessComponent = ({}) => ( {_.map(links, (link, index) => {link.text})} - ); diff --git a/packages/website/ts/@next/pages/landing.tsx b/packages/website/ts/@next/pages/landing.tsx index ad0639fc7..fff9e630d 100644 --- a/packages/website/ts/@next/pages/landing.tsx +++ b/packages/website/ts/@next/pages/landing.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import styled from 'styled-components'; -import { colors } from 'ts/style/colors' +import { colors } from 'ts/style/colors'; + import { Button, ButtonTransparent } from 'ts/@next/components/button'; import { Column, Section, Wrap, WrapCentered } from 'ts/@next/components/layout'; import { SiteWrap } from 'ts/@next/components/siteWrap'; @@ -10,7 +11,6 @@ import { Heading, Intro, Text } from 'ts/@next/components/text'; import logoOutlined from 'ts/@next/icons/illustrations/logo-outlined.svg'; import protocol from 'ts/@next/icons/illustrations/protocol.svg'; - const Icon = styled.div` flex-shrink: 0; `; @@ -23,8 +23,8 @@ export const NextLanding = () => ( Powering Decentralized Exchange 0x is the best solution for adding exchange functionality to your business.
- + Learn More
-- cgit