diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-07 22:32:37 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-07 22:32:37 +0800 |
commit | 238f3c89a7cfc3c8d6941aac4e108c13f84c6647 (patch) | |
tree | 88a97cdf791461b7c278ded2386709204278c669 /packages/react-docs/src/ts/components/documentation.tsx | |
parent | 6e724eb8a5f2431e7dda77102e63316cdd820139 (diff) | |
download | dexon-sol-tools-238f3c89a7cfc3c8d6941aac4e108c13f84c6647.tar dexon-sol-tools-238f3c89a7cfc3c8d6941aac4e108c13f84c6647.tar.gz dexon-sol-tools-238f3c89a7cfc3c8d6941aac4e108c13f84c6647.tar.bz2 dexon-sol-tools-238f3c89a7cfc3c8d6941aac4e108c13f84c6647.tar.lz dexon-sol-tools-238f3c89a7cfc3c8d6941aac4e108c13f84c6647.tar.xz dexon-sol-tools-238f3c89a7cfc3c8d6941aac4e108c13f84c6647.tar.zst dexon-sol-tools-238f3c89a7cfc3c8d6941aac4e108c13f84c6647.zip |
Make sure we apply the appropriate syntax highlighting depending on the language of the docs
Diffstat (limited to 'packages/react-docs/src/ts/components/documentation.tsx')
-rw-r--r-- | packages/react-docs/src/ts/components/documentation.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/react-docs/src/ts/components/documentation.tsx b/packages/react-docs/src/ts/components/documentation.tsx index b5e2bbb9d..d511bbfb4 100644 --- a/packages/react-docs/src/ts/components/documentation.tsx +++ b/packages/react-docs/src/ts/components/documentation.tsx @@ -27,6 +27,7 @@ import { TypeDefinitionByName, TypescriptMethod, } from '../types'; +import { constants } from '../utils/constants'; import { utils } from '../utils/utils'; import { Badge } from './badge'; @@ -318,7 +319,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta private _renderProperty(sectionName: string, property: Property): React.ReactNode { return ( <div key={`property-${property.name}-${property.type.name}`} className="pb3"> - <code className="hljs"> + <code className={`hljs ${constants.TYPE_TO_SYNTAX[this.props.docsInfo.type]}`}> {property.name}: <Type type={property.type} sectionName={sectionName} docsInfo={this.props.docsInfo} /> </code> |