From 77ac03962e3a0f024dc828d6f83df2b989838618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Mon, 9 Jan 2017 12:37:05 +0000 Subject: [PATCH] allow to use button as a function --- ui/src/components/button/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/src/components/button/index.js b/ui/src/components/button/index.js index ef70bd25..cf45c79d 100644 --- a/ui/src/components/button/index.js +++ b/ui/src/components/button/index.js @@ -1,5 +1,6 @@ const constants = require('../../shared/constants'); const fns = require('../../shared/functions'); +const isString = require('lodash.isstring'); const match = require('../../shared/match'); const React = require('react'); const Styled = require('styled-components'); @@ -139,6 +140,15 @@ const StyledAnchor = styled.a` const Button = (props) => { + // support FormattedMessage + if (isString(props)) { + return ( + + {props} + + ); + } + return props.href ? ( ) : (