aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components/type.tsx
diff options
context:
space:
mode:
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}