From 5dac7f043c8217939bc71b2ea1f47a684222a214 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Thu, 16 Aug 2018 14:04:40 +0200 Subject: [PATCH] put back button --- src/js/components/common/Button.js | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/js/components/common/Button.js diff --git a/src/js/components/common/Button.js b/src/js/components/common/Button.js new file mode 100644 index 00000000..6a2db3d1 --- /dev/null +++ b/src/js/components/common/Button.js @@ -0,0 +1,56 @@ +import styled, { css } from 'styled-components'; +import PropTypes from 'prop-types'; +import React from 'react'; + +import colors from 'config/colors'; + +const Wrapper = styled.button` + padding: 12px 24px; + border-radius: 3px; + font-size: 14px; + font-weight: 300; + cursor: pointer; + background: ${colors.GREEN_PRIMARY}; + color: ${colors.WHITE}; + border: 0; + &:hover { + background: ${colors.GREEN_SECONDARY}; + } + &:active { + background: ${colors.GREEN_TERTIARY}; + } + ${props => props.disabled && css` + pointer-events: none; + color: ${colors.TEXT_SECONDARY}; + background: ${colors.GRAY_LIGHT}; + `} +`; + +const Button = ({ + text, onClick, disabled, blue, white, +}) => ( + {text} + +); + +Button.propTypes = { + onClick: PropTypes.func, + disabled: PropTypes.bool, + blue: PropTypes.bool, + white: PropTypes.bool, + text: PropTypes.string.isRequired, +}; + +Button.defaultProps = { + onClick: () => {}, + disabled: false, + blue: false, + white: false, +}; + +export default Button; \ No newline at end of file