diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-05 21:55:28 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-05 21:55:28 +0800 |
commit | fa6bd348992674192d07fef3d60950980212ecbb (patch) | |
tree | 7b8fb8323c972291ddb1c77bc45f73bf39a8f805 /packages/react-docs/src/components/documentation.tsx | |
parent | 5f2cd33da07a7acc65f2e05acb35755f74af75a4 (diff) | |
download | dexon-0x-contracts-fa6bd348992674192d07fef3d60950980212ecbb.tar dexon-0x-contracts-fa6bd348992674192d07fef3d60950980212ecbb.tar.gz dexon-0x-contracts-fa6bd348992674192d07fef3d60950980212ecbb.tar.bz2 dexon-0x-contracts-fa6bd348992674192d07fef3d60950980212ecbb.tar.lz dexon-0x-contracts-fa6bd348992674192d07fef3d60950980212ecbb.tar.xz dexon-0x-contracts-fa6bd348992674192d07fef3d60950980212ecbb.tar.zst dexon-0x-contracts-fa6bd348992674192d07fef3d60950980212ecbb.zip |
Remove type prop and instead infer it from the value of to
Diffstat (limited to 'packages/react-docs/src/components/documentation.tsx')
-rw-r--r-- | packages/react-docs/src/components/documentation.tsx | 23 |
1 files changed, 13 insertions, 10 deletions
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> ); }, ); |