From 437612f8b8c28fb384698c5c2b331e173cee8767 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Wed, 3 Oct 2018 16:37:59 +0100
Subject: Use same Link UI component for react-scroll links

---
 packages/react-docs/src/components/documentation.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'packages/react-docs/src/components/documentation.tsx')

diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx
index 3cd14923c..1ed829b01 100644
--- a/packages/react-docs/src/components/documentation.tsx
+++ b/packages/react-docs/src/components/documentation.tsx
@@ -98,7 +98,10 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
                 marginLeft: 20,
             },
         };
-        const menuSubsectionsBySection = this.props.docsInfo.getMenuSubsectionsBySection(this.props.docAgnosticFormat);
+        const sectionNameToLinks = this.props.docsInfo.getSectionNameToLinks();
+        console.log('sectionNameToLinks', sectionNameToLinks);
+        const subsectionNameToLinks = this.props.docsInfo.getSubsectionNameToLinks(this.props.docAgnosticFormat);
+        console.log('subsectionNameToLinks', subsectionNameToLinks);
         return (
             <div>
                 {_.isUndefined(this.props.docAgnosticFormat) ? (
@@ -128,8 +131,8 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
                                         selectedVersion={this.props.selectedVersion}
                                         versions={this.props.availableVersions}
                                         sidebarHeader={this.props.sidebarHeader}
-                                        topLevelMenu={this.props.docsInfo.menu}
-                                        menuSubsectionsBySection={menuSubsectionsBySection}
+                                        sectionNameToLinks={sectionNameToLinks}
+                                        subsectionNameToLinks={subsectionNameToLinks}
                                         onVersionSelected={this.props.onVersionSelected}
                                     />
                                 </div>
-- 
cgit v1.2.3


From 751e8eafe483efb8b416b88c7edca6676ae9d607 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Wed, 3 Oct 2018 16:41:44 +0100
Subject: Remove stray console.log

---
 packages/react-docs/src/components/documentation.tsx | 2 --
 1 file changed, 2 deletions(-)

(limited to 'packages/react-docs/src/components/documentation.tsx')

diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx
index 1ed829b01..aa6d27402 100644
--- a/packages/react-docs/src/components/documentation.tsx
+++ b/packages/react-docs/src/components/documentation.tsx
@@ -99,9 +99,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
             },
         };
         const sectionNameToLinks = this.props.docsInfo.getSectionNameToLinks();
-        console.log('sectionNameToLinks', sectionNameToLinks);
         const subsectionNameToLinks = this.props.docsInfo.getSubsectionNameToLinks(this.props.docAgnosticFormat);
-        console.log('subsectionNameToLinks', subsectionNameToLinks);
         return (
             <div>
                 {_.isUndefined(this.props.docAgnosticFormat) ? (
-- 
cgit v1.2.3


From fa6bd348992674192d07fef3d60950980212ecbb Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 5 Oct 2018 14:55:28 +0100
Subject: Remove type prop and instead infer it from the value of to

---
 .../react-docs/src/components/documentation.tsx    | 23 ++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

(limited to 'packages/react-docs/src/components/documentation.tsx')

diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx
index de2ccca8b..6a08d50e0 100644
--- a/packages/react-docs/src/components/documentation.tsx
+++ b/packages/react-docs/src/components/documentation.tsx
@@ -2,6 +2,7 @@ import {
     colors,
     constants as sharedConstants,
     EtherscanLinkSuffixes,
+    Link,
     MarkdownSection,
     NestedSidebarMenu,
     Networks,
@@ -319,9 +320,9 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
                 <div className="pt2" key={`external-export-${exportName}`}>
                     <code className={`hljs ${constants.TYPE_TO_SYNTAX[this.props.docsInfo.type]}`}>
                         {`import { `}
-                        <a href={link} target="_blank" style={{ color: colors.lightBlueA700, textDecoration: 'none' }}>
+                        <Link to={link} shouldOpenInNewTab={true} fontColor={colors.lightBlueA700}>
                             {exportName}
-                        </a>
+                        </Link>
                         {` } from '${this.props.docsInfo.packageName}'`}
                     </code>
                 </div>
@@ -350,14 +351,16 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
                     EtherscanLinkSuffixes.Address,
                 );
                 return (
-                    <a
-                        key={`badge-${networkName}-${sectionName}`}
-                        href={linkIfExists}
-                        target="_blank"
-                        style={{ color: colors.white, textDecoration: 'none', marginTop: 8 }}
-                    >
-                        <Badge title={networkName} backgroundColor={networkNameToColor[networkName]} />
-                    </a>
+                    <div style={{ marginTop: 8 }}>
+                        <Link
+                            key={`badge-${networkName}-${sectionName}`}
+                            to={linkIfExists}
+                            shouldOpenInNewTab={true}
+                            fontColor={colors.white}
+                        >
+                            <Badge title={networkName} backgroundColor={networkNameToColor[networkName]} />
+                        </Link>
+                    </div>
                 );
             },
         );
-- 
cgit v1.2.3

