aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-23 23:55:41 +0800
committerFabio Berger <me@fabioberger.com>2018-08-23 23:55:41 +0800
commit28f077b16f5fc5f08f95bb2ad00724e6ea89dd00 (patch)
treedba9e82409721d44ad41d7a434f3378f075486e9 /packages/react-docs/src/components
parent3563fabe8871f69799dd7c89b83ecea19951794c (diff)
downloaddexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.gz
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.bz2
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.lz
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.xz
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.tar.zst
dexon-sol-tools-28f077b16f5fc5f08f95bb2ad00724e6ea89dd00.zip
Add support for rending the Tuple type
Diffstat (limited to 'packages/react-docs/src/components')
-rw-r--r--packages/react-docs/src/components/type.tsx22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index 145c797a3..5f7601ce1 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -167,6 +167,28 @@ export const Type: React.SFC<TypeProps> = (props: TypeProps): any => {
});
break;
+ case TypeDocTypes.Tuple:
+ const tupleTypes = _.map(type.tupleElements, t => {
+ return (
+ <Type
+ key={`type-tuple-${t.name}-${t.typeDocType}`}
+ type={t}
+ sectionName={props.sectionName}
+ typeDefinitionByName={props.typeDefinitionByName}
+ docsInfo={props.docsInfo}
+ isInPopover={props.isInPopover}
+ />
+ );
+ });
+ typeName = (
+ <div>
+ [{_.reduce(tupleTypes, (prev: React.ReactNode, curr: React.ReactNode) => {
+ return [prev, ', ', curr];
+ })}]
+ </div>
+ );
+ break;
+
default:
throw errorUtils.spawnSwitchErr('type.typeDocType', type.typeDocType);
}