1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-25 00:18:07 +00:00

Use Link instead of <a/>

This commit is contained in:
Vasek Mlejnsky 2018-08-24 08:45:00 +02:00
parent aa6e37fc38
commit 58666ceb45
2 changed files with 12 additions and 6 deletions

View File

@ -1,10 +1,12 @@
import styled from 'styled-components';
import PropTypes from 'prop-types';
import React from 'react';
import Link from 'components/Link';
import { getYear } from 'date-fns';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import colors from 'config/colors';
import * as LogActions from 'actions/LogActions';
@ -17,7 +19,7 @@ const Wrapper = styled.div`
display: flex;
`;
const A = styled.a`
const LinkWrapper = styled(Link)`
margin: 0 6px;
margin-right: 20px;
`;
@ -29,9 +31,9 @@ const Copy = styled.div`
const Footer = ({ toggle }) => (
<Wrapper>
<Copy>&copy; {getYear(new Date())}</Copy>
<A href="http://satoshilabs.com" target="_blank" rel="noreferrer noopener" className="satoshi green">SatoshiLabs</A>
<A href="tos.pdf" target="_blank" rel="noreferrer noopener" className="green">Terms</A>
<A onClick={toggle} className="green">Show Log</A>
<LinkWrapper href="http://satoshilabs.com" target="_blank" rel="noreferrer noopener" className="satoshi" isGreen>SatoshiLabs</LinkWrapper>
<LinkWrapper href="tos.pdf" target="_blank" rel="noreferrer noopener" isGreen>Terms</LinkWrapper>
<LinkWrapper onClick={toggle} isGreen>Show Log</LinkWrapper>
</Wrapper>
);

View File

@ -47,12 +47,14 @@ const A = styled.a`
`;
const Link = ({
children, href, target, rel, isGreen = false, isGray = false,
children, className, href, target, rel, onClick, isGreen = false, isGray = false,
}) => (
<A
className={className}
href={href}
target={target}
rel={rel}
onClick={onClick}
isGreen={isGreen}
isGray={isGray}
>{children}
@ -65,9 +67,11 @@ Link.propTypes = {
PropTypes.object,
PropTypes.array,
]).isRequired,
href: PropTypes.string.isRequired,
className: PropTypes.string,
href: PropTypes.string,
target: PropTypes.string,
rel: PropTypes.string,
onClick: PropTypes.func,
isGreen: PropTypes.bool,
isGray: PropTypes.bool,
};