1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-15 21:08:57 +00:00

Link can now has children

This commit is contained in:
Vasek Mlejnsky 2018-08-24 06:30:09 +02:00
parent 86bf1b6446
commit 9f5bb3c1a6
2 changed files with 18 additions and 9 deletions

View File

@ -47,7 +47,7 @@ const A = styled.a`
`;
const Link = ({
text, href, target, rel, isGreen = false, isGray = false,
children, href, target, rel, isGreen = false, isGray = false,
}) => (
<A
href={href}
@ -55,12 +55,15 @@ const Link = ({
rel={rel}
isGreen={isGreen}
isGray={isGray}
>{text}
>{children}
</A>
);
Link.propTypes = {
text: PropTypes.string.isRequired,
children: PropTypes.oneOfType([
PropTypes.string,
PropTypes.array,
]).isRequired,
href: PropTypes.string.isRequired,
target: PropTypes.string,
rel: PropTypes.string,

View File

@ -1,6 +1,7 @@
import React from 'react';
import styled, { css } from 'styled-components';
import Link from 'components/Link';
import Button from 'components/Button';
import P from 'components/Paragraph';
import { H2 } from 'components/Heading';
@ -39,23 +40,28 @@ const BrowserNotSupported = () => (
<BrowserLogo isChrome />
<P isSmaller>Google Chrome</P>
<Link
text="Get Chrome"
href="https://www.google.com/chrome/"
target="_blank"
rel="noreferrer noopener"
isButton
/>
>
<Button
text="Get Chrome"
/>
</Link>
</Browser>
<Browser>
<BrowserLogo isFirefox />
<P isSmaller>Mozzila Firefox</P>
<Link
text="Get Firefox"
href="https://www.mozilla.org/en-US/firefox/new/"
target="_blank"
rel="noreferrer noopener"
isButton
/>
>
<Button
text="Get Firefox"
/>
</Link>
</Browser>
</ChooseBrowserWrapper>
</Wrapper>