aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/@next/components/link.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-12-18 06:37:34 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-12-18 06:37:34 +0800
commita77e5a1a127e7e25281ff94c88b7a1a0034613b6 (patch)
tree414cee916b8c8979100770dfee16ecbac9ecadf2 /packages/website/ts/@next/components/link.tsx
parent9df0ae90bc98a80100cb254341d124568edd061e (diff)
downloaddexon-0x-contracts-a77e5a1a127e7e25281ff94c88b7a1a0034613b6.tar.gz
dexon-0x-contracts-a77e5a1a127e7e25281ff94c88b7a1a0034613b6.tar.zst
dexon-0x-contracts-a77e5a1a127e7e25281ff94c88b7a1a0034613b6.zip
feat: fix links in navbar and dropdown
Diffstat (limited to 'packages/website/ts/@next/components/link.tsx')
-rw-r--r--packages/website/ts/@next/components/link.tsx22
1 files changed, 14 insertions, 8 deletions
diff --git a/packages/website/ts/@next/components/link.tsx b/packages/website/ts/@next/components/link.tsx
index c3633987a..6ca1e44c1 100644
--- a/packages/website/ts/@next/components/link.tsx
+++ b/packages/website/ts/@next/components/link.tsx
@@ -1,5 +1,5 @@
+import { Link as SmartLink } from '@0x/react-shared';
import * as React from 'react';
-import { Link as ReactRouterLink } from 'react-router-dom';
import styled from 'styled-components';
interface LinkInterface {
@@ -16,16 +16,19 @@ interface LinkInterface {
}
export const Link = (props: LinkInterface) => {
- const {
- children,
- isNoArrow,
- href,
- } = props;
+ const { children, isNoArrow, href } = props;
return (
<StyledLink to={href} {...props}>
{children}
- {!isNoArrow && <svg width="25" height="25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.484 5.246l.023 1.411 8.147.053L4.817 18.547l.996.996L17.65 7.706l.052 8.146 1.411.024-.068-10.561-10.561-.069z" fill="currentColor"/></svg>}
+ {!isNoArrow && (
+ <svg width="25" height="25" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M8.484 5.246l.023 1.411 8.147.053L4.817 18.547l.996.996L17.65 7.706l.052 8.146 1.411.024-.068-10.561-10.561-.069z"
+ fill="currentColor"
+ />
+ </svg>
+ )}
</StyledLink>
);
};
@@ -39,7 +42,10 @@ export const LinkWrap = styled.div`
}
`;
-const StyledLink = styled(ReactRouterLink)<LinkInterface>`
+const StyledLink =
+ styled(SmartLink) <
+ LinkInterface >
+ `
display: ${props => !props.isBlock && 'inline-flex'};
color: ${props => props.color || props.theme.linkColor};
text-align: center;