Skip to content

Commit

Permalink
Adjust button styling and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
domyen committed Jun 15, 2018
1 parent 46f7af7 commit ba5ccc7
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import PropTypes from "prop-types";
import styled, { css } from "styled-components";
import { darken } from "polished";
import { color, typography, breakpoint } from "./shared/styles";
import React from 'react';
import PropTypes from 'prop-types';
import styled, { css } from 'styled-components';
import { darken } from 'polished';
import { color, typography } from './shared/styles';

const Text = styled.span`
display: inline-block;
Expand Down Expand Up @@ -30,12 +30,8 @@ const ButtonWrapper = styled.button`
background: transparent;
padding: 16px 25px;
font-size: ${typography.size.s3}px;
@media (min-width: ${breakpoint * 2}px) {
padding: ${props => props.small ? '16px 25px' : '20px 30px'};
font-size: ${props => props.small ? typography.size.s3 : typography.size.m1}px;
}
padding: ${props => props.small ? '8px 16px' : '13px 20px'};
font-size: ${props => props.small ? typography.size.s2 : typography.size.s3}px;
font-weight: ${typography.weight.extrabold};
line-height: 1;
Expand Down Expand Up @@ -186,7 +182,7 @@ const ButtonWrapper = styled.button`
`;

const ButtonLink = ButtonWrapper.withComponent("a");
const ButtonLink = ButtonWrapper.withComponent('a');

function Button({ isLink, children, ...props }) {
if (isLink) {
Expand All @@ -205,11 +201,11 @@ function Button({ isLink, children, ...props }) {

Button.propTypes = {
isLink: PropTypes.bool,
children: PropTypes.node.isRequired
children: PropTypes.node.isRequired,
};

Button.defaultProps = {
isLink: false
isLink: false,
};

export default Button;

0 comments on commit ba5ccc7

Please sign in to comment.