diff options
author | Fabio Berger <me@fabioberger.com> | 2018-02-09 09:36:17 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-02-09 09:36:17 +0800 |
commit | ddf4437fb66fd5bb45572a330fdf383b973ce373 (patch) | |
tree | aa7ca5229fd299b9786856c7e9da92fa83669f3c /packages/website/ts/components/top_bar/top_bar_menu_item.tsx | |
parent | 4153d5784954ea7a507011a954334166f9d71a3b (diff) | |
download | dexon-sol-tools-ddf4437fb66fd5bb45572a330fdf383b973ce373.tar dexon-sol-tools-ddf4437fb66fd5bb45572a330fdf383b973ce373.tar.gz dexon-sol-tools-ddf4437fb66fd5bb45572a330fdf383b973ce373.tar.bz2 dexon-sol-tools-ddf4437fb66fd5bb45572a330fdf383b973ce373.tar.lz dexon-sol-tools-ddf4437fb66fd5bb45572a330fdf383b973ce373.tar.xz dexon-sol-tools-ddf4437fb66fd5bb45572a330fdf383b973ce373.tar.zst dexon-sol-tools-ddf4437fb66fd5bb45572a330fdf383b973ce373.zip |
Add blog to topBar and as a consequence support external links in topBar menu items
Diffstat (limited to 'packages/website/ts/components/top_bar/top_bar_menu_item.tsx')
-rw-r--r-- | packages/website/ts/components/top_bar/top_bar_menu_item.tsx | 18 |
1 files changed, 15 insertions, 3 deletions
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 96ee86142..983050abc 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 @@ -11,6 +11,7 @@ interface TopBarMenuItemProps { title: string; path?: string; isPrimary?: boolean; + isExternal: boolean; style?: React.CSSProperties; className?: string; isNightVersion?: boolean; @@ -43,9 +44,20 @@ export class TopBarMenuItem extends React.Component<TopBarMenuItemProps, TopBarM className={`center ${this.props.className}`} style={{ ...this.props.style, ...primaryStyles, color: menuItemColor }} > - <Link to={this.props.path} className="text-decoration-none" style={{ color: linkColor }}> - {this.props.title} - </Link> + {this.props.isExternal ? ( + <a + className="text-decoration-none" + style={{ color: linkColor }} + target="_blank" + href={this.props.path} + > + {this.props.title} + </a> + ) : ( + <Link to={this.props.path} className="text-decoration-none" style={{ color: linkColor }}> + {this.props.title} + </Link> + )} </div> ); } |