From 70b640fddfafb15cdb2869e446f1c264e7e40337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Thu, 23 Mar 2017 13:43:00 +0000 Subject: [PATCH] fix incorrect map of anchor to Link --- frontend/src/containers/projects/index.js | 2 +- ui/src/components/button/index.js | 22 +++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/frontend/src/containers/projects/index.js b/frontend/src/containers/projects/index.js index 2da05325..0f34615c 100644 --- a/frontend/src/containers/projects/index.js +++ b/frontend/src/containers/projects/index.js @@ -33,7 +33,7 @@ const Projects = ({ {empty} - diff --git a/ui/src/components/button/index.js b/ui/src/components/button/index.js index 9fe53efd..5c36f505 100644 --- a/ui/src/components/button/index.js +++ b/ui/src/components/button/index.js @@ -1,7 +1,6 @@ import { colors, boxes } from '../../shared/constants'; import { Baseline, typography, paperEffect } from '../../shared/composers'; import { remcalc } from '../../shared/functions'; -import isString from 'lodash.isstring'; import match from '../../shared/match'; import React from 'react'; import styled, { css } from 'styled-components'; @@ -140,7 +139,7 @@ const StyledButton = styled.button` } `; -const StyledAnchor = styled(Link)` +const StyledAnchor = styled.a` display: inline-block; ${style} `; @@ -151,25 +150,15 @@ const StyledLink = styled(Link)` `; const Button = (props) => { - // support FormattedMessage - if (isString(props)) { - return ( - - {props} - - ); - } - const { href = '', - to = '', - rr = false + to = '' } = props; const Views = [ - () => !to && !href ? StyledButton : null, - () => !rr ? StyledAnchor : null, - () => StyledLink + () => to ? StyledLink : null, + () => href ? StyledAnchor : null, + () => StyledButton ]; const View = Views.reduce((sel, view) => sel ? sel : view(), null); @@ -184,7 +173,6 @@ const Button = (props) => { Button.propTypes = { children: React.PropTypes.node, href: React.PropTypes.string, - rr: React.PropTypes.bool, to: React.PropTypes.string };