aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-16 02:36:45 +0800
committerFabio Berger <me@fabioberger.com>2018-08-16 02:36:45 +0800
commita8d44ccc48a7177e749f534a237afb7b9c0f2f2b (patch)
tree35e931893e7d73c32b54fa42ca31930e2fd4540d /packages/react-docs/src/components
parent3b8a343711e0b23a453a1466411e2b9ca68eb0b2 (diff)
downloaddexon-sol-tools-a8d44ccc48a7177e749f534a237afb7b9c0f2f2b.tar
dexon-sol-tools-a8d44ccc48a7177e749f534a237afb7b9c0f2f2b.tar.gz
dexon-sol-tools-a8d44ccc48a7177e749f534a237afb7b9c0f2f2b.tar.bz2
dexon-sol-tools-a8d44ccc48a7177e749f534a237afb7b9c0f2f2b.tar.lz
dexon-sol-tools-a8d44ccc48a7177e749f534a237afb7b9c0f2f2b.tar.xz
dexon-sol-tools-a8d44ccc48a7177e749f534a237afb7b9c0f2f2b.tar.zst
dexon-sol-tools-a8d44ccc48a7177e749f534a237afb7b9c0f2f2b.zip
Move external types to link mapping to doc generation util and refactor typedocUtils to be a class to avoid excessive param passing
Diffstat (limited to 'packages/react-docs/src/components')
-rw-r--r--packages/react-docs/src/components/signature_block.tsx1
-rw-r--r--packages/react-docs/src/components/type.tsx12
2 files changed, 1 insertions, 12 deletions
diff --git a/packages/react-docs/src/components/signature_block.tsx b/packages/react-docs/src/components/signature_block.tsx
index 2818d9c5f..05145dc23 100644
--- a/packages/react-docs/src/components/signature_block.tsx
+++ b/packages/react-docs/src/components/signature_block.tsx
@@ -5,7 +5,6 @@ import * as React from 'react';
import { DocsInfo } from '../docs_info';
import { Parameter, SolidityMethod, TypeDefinitionByName, TypescriptFunction, TypescriptMethod } from '../types';
import { constants } from '../utils/constants';
-import { typeDocUtils } from '../utils/typedoc_utils';
import { Comment } from './comment';
import { Signature } from './signature';
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index eae52e950..145c797a3 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -179,17 +179,8 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
return [prev, ', ', curr];
});
- let typeNameUrlIfExists;
- let typePrefixIfExists;
- if (!_.isUndefined(props.docsInfo.typeConfigs)) {
- typeNameUrlIfExists = !_.isUndefined(props.docsInfo.typeConfigs.typeNameToExternalLink)
- ? props.docsInfo.typeConfigs.typeNameToExternalLink[typeName as string]
- : undefined;
- typePrefixIfExists = !_.isUndefined(props.docsInfo.typeConfigs.typeNameToPrefix)
- ? props.docsInfo.typeConfigs.typeNameToPrefix[typeName as string]
- : undefined;
- }
const isExportedClassReference = !!props.type.isExportedClassReference;
+ const typeNameUrlIfExists = !_.isUndefined(props.type.externalLink) ? props.type.externalLink : undefined;
if (!_.isUndefined(typeNameUrlIfExists)) {
typeName = (
<a
@@ -198,7 +189,6 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
className="text-decoration-none"
style={{ color: colors.lightBlueA700 }}
>
- {!_.isUndefined(typePrefixIfExists) ? `${typePrefixIfExists}.` : ''}
{typeName}
</a>
);