aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components/type.tsx
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-05 02:03:01 +0800
committerFabio Berger <me@fabioberger.com>2018-10-05 02:03:01 +0800
commitc9bfb86960d3c57c8cdefb4d044036028bfb47ed (patch)
tree52e6e2185c7a03338930111661b32d75aeea29cb /packages/react-docs/src/components/type.tsx
parentd0b2b4d0aa8b67c6f867f83c9b35b8e49c57b4a1 (diff)
parent3991e66a58f28dbed5e75f74ef4aaaf6bb3a4d3e (diff)
downloaddexon-sol-tools-c9bfb86960d3c57c8cdefb4d044036028bfb47ed.tar
dexon-sol-tools-c9bfb86960d3c57c8cdefb4d044036028bfb47ed.tar.gz
dexon-sol-tools-c9bfb86960d3c57c8cdefb4d044036028bfb47ed.tar.bz2
dexon-sol-tools-c9bfb86960d3c57c8cdefb4d044036028bfb47ed.tar.lz
dexon-sol-tools-c9bfb86960d3c57c8cdefb4d044036028bfb47ed.tar.xz
dexon-sol-tools-c9bfb86960d3c57c8cdefb4d044036028bfb47ed.tar.zst
dexon-sol-tools-c9bfb86960d3c57c8cdefb4d044036028bfb47ed.zip
merge base branch
Diffstat (limited to 'packages/react-docs/src/components/type.tsx')
-rw-r--r--packages/react-docs/src/components/type.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index 156a3496d..5c018f5dd 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -7,12 +7,12 @@ import { Link as ScrollLink } from 'react-scroll';
import * as ReactTooltip from 'react-tooltip';
import { DocsInfo } from '../docs_info';
-import { constants } from '../utils/constants';
import { Signature } from './signature';
import { TypeDefinition } from './type_definition';
const basicJsTypes = ['string', 'number', 'undefined', 'null', 'boolean'];
+const basicSolidityTypes = ['bytes', 'bytes4', 'bytes32', 'uint8', 'uint256', 'address'];
const defaultProps = {};
@@ -80,7 +80,7 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
case TypeDocTypes.Array:
typeName = type.elementType.name;
- if (_.includes(basicJsTypes, typeName)) {
+ if (_.includes(basicJsTypes, typeName) || _.includes(basicSolidityTypes, typeName)) {
typeNameColor = colors.orange;
}
break;
@@ -168,10 +168,10 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
break;
case TypeDocTypes.Tuple:
- const tupleTypes = _.map(type.tupleElements, t => {
+ const tupleTypes = _.map(type.tupleElements, (t, i) => {
return (
<Type
- key={`type-tuple-${t.name}-${t.typeDocType}`}
+ key={`type-tuple-${t.name}-${t.typeDocType}-${i}`}
type={t}
sectionName={props.sectionName}
typeDefinitionByName={props.typeDefinitionByName}
@@ -221,7 +221,7 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
const id = Math.random().toString();
const typeDefinitionAnchorId = isExportedClassReference
? props.type.name
- : `${constants.TYPES_SECTION_NAME}-${typeName}`;
+ : `${props.docsInfo.typeSectionName}-${typeName}`;
typeName = (
<ScrollLink
to={typeDefinitionAnchorId}