aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/ts')
-rw-r--r--packages/website/ts/components/dropdowns/developers_drop_down.tsx16
-rw-r--r--packages/website/ts/components/top_bar/top_bar.tsx1
2 files changed, 11 insertions, 6 deletions
diff --git a/packages/website/ts/components/dropdowns/developers_drop_down.tsx b/packages/website/ts/components/dropdowns/developers_drop_down.tsx
index 6133c8b4d..ac1d82c75 100644
--- a/packages/website/ts/components/dropdowns/developers_drop_down.tsx
+++ b/packages/website/ts/components/dropdowns/developers_drop_down.tsx
@@ -64,6 +64,7 @@ const usefulLinksToLinkInfo: ALink[] = [
];
interface DevelopersDropDownProps {
+ location: Location;
translate: Translate;
menuItemStyles: React.CSSProperties;
menuIconStyle: React.CSSProperties;
@@ -165,17 +166,20 @@ export class DevelopersDropDown extends React.Component<DevelopersDropDownProps,
const numLinks = links.length;
let i = 0;
const renderLinks = _.map(links, (link: ALink) => {
+ const isWikiLink = _.startsWith(link.to, WebsitePaths.Wiki) && _.includes(link.to, '#');
+ const isOnWiki = this.props.location.pathname === WebsitePaths.Wiki;
+ let to = link.to;
+ let type = link.type;
+ if (isWikiLink && isOnWiki) {
+ to = `${link.to.split('#')[1]}`;
+ type = LinkType.ReactScroll;
+ }
i++;
const isLast = i === numLinks;
const linkText = this.props.translate.get(link.title as Key, Deco.Cap);
return (
<div className={`pr1 pt1 ${!isLast && 'pb1'}`} key={`dev-dropdown-link-${link.title}`}>
- <Link
- to={link.to}
- type={link.type}
- shouldOpenInNewTab={!!link.shouldOpenInNewTab}
- style={linkStyle}
- >
+ <Link to={to} type={type} shouldOpenInNewTab={!!link.shouldOpenInNewTab} style={linkStyle}>
{linkText}
</Link>
</div>
diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx
index e25c0a0f7..d05b72d98 100644
--- a/packages/website/ts/components/top_bar/top_bar.tsx
+++ b/packages/website/ts/components/top_bar/top_bar.tsx
@@ -161,6 +161,7 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
<div className={menuClasses}>
<div className="flex items-center justify-between">
<DevelopersDropDown
+ location={this.props.location}
menuItemStyles={styles.menuItem}
translate={this.props.translate}
menuIconStyle={menuIconStyle}