aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-03 19:02:14 +0800
committerFabio Berger <me@fabioberger.com>2018-08-03 19:02:14 +0800
commitd136df7679b85eff054178ae8103ecd1f3b324f9 (patch)
treee67e27d0daec30ead7d09d70e9bf0279c2f51292 /packages/react-docs/src/components
parent8c96a31152064a94513c72daec1a66510a49fde4 (diff)
downloaddexon-sol-tools-d136df7679b85eff054178ae8103ecd1f3b324f9.tar
dexon-sol-tools-d136df7679b85eff054178ae8103ecd1f3b324f9.tar.gz
dexon-sol-tools-d136df7679b85eff054178ae8103ecd1f3b324f9.tar.bz2
dexon-sol-tools-d136df7679b85eff054178ae8103ecd1f3b324f9.tar.lz
dexon-sol-tools-d136df7679b85eff054178ae8103ecd1f3b324f9.tar.xz
dexon-sol-tools-d136df7679b85eff054178ae8103ecd1f3b324f9.tar.zst
dexon-sol-tools-d136df7679b85eff054178ae8103ecd1f3b324f9.zip
Color-code basic type arrays orange aswell
Diffstat (limited to 'packages/react-docs/src/components')
-rw-r--r--packages/react-docs/src/components/type.tsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index ea66c7b1e..40564c0d6 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -12,6 +12,8 @@ import { Signature } from './signature';
import { constants } from '../utils/constants';
import { TypeDefinition } from './type_definition';
+const basicJsTypes = ['string', 'number', 'undefined', 'null', 'boolean'];
+
export interface TypeProps {
type: TypeDef;
docsInfo: DocsInfo;
@@ -73,6 +75,9 @@ export function Type(props: TypeProps): any {
case TypeDocTypes.Array:
typeName = type.elementType.name;
+ if (_.includes(basicJsTypes, typeName)) {
+ typeNameColor = colors.orange;
+ }
break;
case TypeDocTypes.Union: