From e9581af8e88ca8e74039989331d8e4e581fa08ed Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Mon, 13 Aug 2018 17:19:04 +0200 Subject: [PATCH] Added button components --- src/js/components/common/Button.js | 63 +++++++++++++++++++ src/js/components/common/Link.js | 14 ----- .../components/wallet/pages/DeviceSettings.js | 5 +- 3 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 src/js/components/common/Button.js delete mode 100644 src/js/components/common/Link.js diff --git a/src/js/components/common/Button.js b/src/js/components/common/Button.js new file mode 100644 index 00000000..735f20b3 --- /dev/null +++ b/src/js/components/common/Button.js @@ -0,0 +1,63 @@ +import styled, { css } from 'styled-components'; +import PropTypes from 'prop-types'; +import React from 'react'; + +import colors from '~/js/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}; + `} + + ${props => props.blue && css``} + + ${props => props.white && css``} +`; + +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; diff --git a/src/js/components/common/Link.js b/src/js/components/common/Link.js deleted file mode 100644 index e5bb7a9c..00000000 --- a/src/js/components/common/Link.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import styled from 'styled-components'; -import colors from '~/js/config/colors'; - -const StyledLink = styled.a` - color: red; - text-decoration -`; - -const Link = ({ href, name }) => ( - -); - -export default StyledLink; diff --git a/src/js/components/wallet/pages/DeviceSettings.js b/src/js/components/wallet/pages/DeviceSettings.js index a02a2f62..fb2cc68f 100644 --- a/src/js/components/wallet/pages/DeviceSettings.js +++ b/src/js/components/wallet/pages/DeviceSettings.js @@ -3,6 +3,7 @@ import styled from 'styled-components'; import { H2 } from '~/js/components/common/Heading'; import Icon from '~/js/components/common/Icon'; import colors from '~/js/config/colors'; +import Button from '~/js/components/common/Button'; import ICONS from '~/js/constants/icons'; import { connect } from 'react-redux'; @@ -37,7 +38,9 @@ export const DeviceSettings = () => ( /> Device settings is under construction

Please use Bitcoin wallet interface to change your device settings

- Take me to the Bitcoin wallet + +