aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/top_bar
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-05 21:55:28 +0800
committerFabio Berger <me@fabioberger.com>2018-10-05 21:55:28 +0800
commitfa6bd348992674192d07fef3d60950980212ecbb (patch)
tree7b8fb8323c972291ddb1c77bc45f73bf39a8f805 /packages/website/ts/components/top_bar
parent5f2cd33da07a7acc65f2e05acb35755f74af75a4 (diff)
downloaddexon-sol-tools-fa6bd348992674192d07fef3d60950980212ecbb.tar
dexon-sol-tools-fa6bd348992674192d07fef3d60950980212ecbb.tar.gz
dexon-sol-tools-fa6bd348992674192d07fef3d60950980212ecbb.tar.bz2
dexon-sol-tools-fa6bd348992674192d07fef3d60950980212ecbb.tar.lz
dexon-sol-tools-fa6bd348992674192d07fef3d60950980212ecbb.tar.xz
dexon-sol-tools-fa6bd348992674192d07fef3d60950980212ecbb.tar.zst
dexon-sol-tools-fa6bd348992674192d07fef3d60950980212ecbb.zip
Remove type prop and instead infer it from the value of to
Diffstat (limited to 'packages/website/ts/components/top_bar')
-rw-r--r--packages/website/ts/components/top_bar/top_bar.tsx16
-rw-r--r--packages/website/ts/components/top_bar/top_bar_menu_item.tsx7
2 files changed, 8 insertions, 15 deletions
diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx
index d05b72d98..3297befad 100644
--- a/packages/website/ts/components/top_bar/top_bar.tsx
+++ b/packages/website/ts/components/top_bar/top_bar.tsx
@@ -1,13 +1,5 @@
import { DocsInfo } from '@0xproject/react-docs';
-import {
- ALink,
- colors,
- constants as sharedConstants,
- Link,
- LinkType,
- NestedSidebarMenu,
- Styles,
-} from '@0xproject/react-shared';
+import { ALink, colors, constants as sharedConstants, Link, NestedSidebarMenu, Styles } from '@0xproject/react-shared';
import { ObjectMap } from '@0xproject/types';
import * as _ from 'lodash';
import Drawer from 'material-ui/Drawer';
@@ -177,7 +169,7 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
path={constants.URL_BLOG}
style={styles.menuItem}
isNightVersion={isNightVersion}
- linkType={LinkType.External}
+ shouldOpenInNewTab={true}
/>
<TopBarMenuItem
title={this.props.translate.get(Key.About, Deco.Cap)}
@@ -285,7 +277,7 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
</MenuItem>
</Link>
)}
- <Link to={WebsitePaths.Whitepaper} type={LinkType.External} shouldOpenInNewTab={true}>
+ <Link to={WebsitePaths.Whitepaper} shouldOpenInNewTab={true}>
<MenuItem className="py2">{this.props.translate.get(Key.Whitepaper, Deco.Cap)}</MenuItem>
</Link>
<Link to={WebsitePaths.About}>
@@ -294,7 +286,7 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
<Link to={WebsitePaths.Careers}>
<MenuItem className="py2">{this.props.translate.get(Key.Careers, Deco.Cap)}</MenuItem>
</Link>
- <Link to={constants.URL_BLOG} type={LinkType.External} shouldOpenInNewTab={true}>
+ <Link to={constants.URL_BLOG} shouldOpenInNewTab={true}>
<MenuItem className="py2">{this.props.translate.get(Key.Blog, Deco.Cap)}</MenuItem>
</Link>
<Link to={WebsitePaths.FAQ}>
diff --git a/packages/website/ts/components/top_bar/top_bar_menu_item.tsx b/packages/website/ts/components/top_bar/top_bar_menu_item.tsx
index c88db95fa..eff5ba66d 100644
--- a/packages/website/ts/components/top_bar/top_bar_menu_item.tsx
+++ b/packages/website/ts/components/top_bar/top_bar_menu_item.tsx
@@ -1,4 +1,4 @@
-import { colors, Link, LinkType } from '@0xproject/react-shared';
+import { colors, Link } from '@0xproject/react-shared';
import * as _ from 'lodash';
import * as React from 'react';
@@ -12,7 +12,7 @@ interface TopBarMenuItemProps {
title: string;
path?: string;
isPrimary?: boolean;
- linkType: LinkType;
+ shouldOpenInNewTab?: boolean;
style?: React.CSSProperties;
className?: string;
isNightVersion?: boolean;
@@ -25,6 +25,7 @@ export class TopBarMenuItem extends React.Component<TopBarMenuItemProps, TopBarM
isPrimary: false,
style: DEFAULT_STYLE,
className: '',
+ shouldOpenInNewTab: false,
isNightVersion: false,
};
public render(): React.ReactNode {
@@ -37,7 +38,7 @@ export class TopBarMenuItem extends React.Component<TopBarMenuItemProps, TopBarM
);
return (
<div className={`center ${this.props.className}`} style={{ ...this.props.style, color: menuItemColor }}>
- <Link to={this.props.path} type={this.props.linkType} fontColor={linkColor}>
+ <Link to={this.props.path} shouldOpenInNewTab={this.props.shouldOpenInNewTab} fontColor={linkColor}>
{itemContent}
</Link>
</div>