1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

Added button components

This commit is contained in:
Vladimir Volek 2018-08-13 17:19:04 +02:00
parent 49ad6726cb
commit e9581af8e8
3 changed files with 67 additions and 15 deletions

View File

@ -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,
}) => (
<Wrapper
onClick={onClick}
disabled={disabled}
blue={blue}
white={white}
>{text}
</Wrapper>
);
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;

View File

@ -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 }) => (
<Link href={href} />
);
export default StyledLink;

View File

@ -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 = () => (
/>
<StyledH2>Device settings is under construction</StyledH2>
<P>Please use Bitcoin wallet interface to change your device settings</P>
<a className="button" href="https://wallet.trezor.io/">Take me to the Bitcoin wallet</a>
<a href="https://wallet.trezor.io/">
<Button text="Take me to the Bitcoin wallet" />
</a>
</Row>
</Section>
);