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

View File

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