diff options
author | Fabio Berger <me@fabioberger.com> | 2018-09-28 02:50:02 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-09-28 02:50:02 +0800 |
commit | ac04dbf7e4f04ae4e0a6e9cce5232339597493ed (patch) | |
tree | ceac79e7921544506228aa3774dc543fe0971529 | |
parent | cfddea931dedb77a88507517957e19350e9348b8 (diff) | |
download | dexon-sol-tools-ac04dbf7e4f04ae4e0a6e9cce5232339597493ed.tar dexon-sol-tools-ac04dbf7e4f04ae4e0a6e9cce5232339597493ed.tar.gz dexon-sol-tools-ac04dbf7e4f04ae4e0a6e9cce5232339597493ed.tar.bz2 dexon-sol-tools-ac04dbf7e4f04ae4e0a6e9cce5232339597493ed.tar.lz dexon-sol-tools-ac04dbf7e4f04ae4e0a6e9cce5232339597493ed.tar.xz dexon-sol-tools-ac04dbf7e4f04ae4e0a6e9cce5232339597493ed.tar.zst dexon-sol-tools-ac04dbf7e4f04ae4e0a6e9cce5232339597493ed.zip |
Re-use interface component for rendering structs but label it differently
-rw-r--r-- | packages/react-docs/src/components/type_definition.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/react-docs/src/components/type_definition.tsx b/packages/react-docs/src/components/type_definition.tsx index 09cb3ff74..9a3e50a1b 100644 --- a/packages/react-docs/src/components/type_definition.tsx +++ b/packages/react-docs/src/components/type_definition.tsx @@ -5,7 +5,7 @@ import * as _ from 'lodash'; import * as React from 'react'; import { DocsInfo } from '../docs_info'; -import { KindString } from '../types'; +import { KindString, SupportedDocJson } from '../types'; import { constants } from '../utils/constants'; import { Comment } from './comment'; @@ -46,7 +46,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef let codeSnippet: React.ReactNode; switch (customType.kindString) { case KindString.Interface: - typePrefix = 'Interface'; + typePrefix = this.props.docsInfo.type === SupportedDocJson.SolDoc ? 'Struct' : 'Interface'; codeSnippet = ( <Interface type={customType} |