@@ -12,36 +12,38 @@ import './index.scss';
1212// Function for get icons
1313const getTopLevelIcons = ( field : FieldMapType ) => {
1414 const icons : Icons = {
15- title : 'StarSmall ' ,
16- text : 'SingleLineTextSmall ' ,
17- multitext : 'MultiLineTextSmall ' ,
18- rte : 'RichTextEditorSmall ' ,
19- jsonRte : 'SuperchargedRte ' ,
20- markdown : 'MarkdownSmall ' ,
21- select : 'SelectSmall ' ,
22- number : 'NumberSmall ' ,
23- boolean : 'BooleanSmall ' ,
24- isodate : 'DateSmall ' ,
25- file : 'FileSmall ' ,
26- reference : 'ReferenceSmall ' ,
27- group : 'GroupSmall ' ,
28- global_field : 'GlobalSmall ' ,
29- blocks : 'ModularBlocksSmall ' ,
30- link : 'LinkSmall ' ,
15+ title : 'Title ' ,
16+ text : 'SingleLineText ' ,
17+ multitext : 'MultiLineText ' ,
18+ rte : 'RichTextEditor ' ,
19+ jsonRte : 'JsonRichTextEditor ' ,
20+ markdown : 'Markdown ' ,
21+ select : 'Select ' ,
22+ number : 'Number ' ,
23+ boolean : 'Boolean ' ,
24+ isodate : 'Date ' ,
25+ file : 'File ' ,
26+ reference : 'Reference ' ,
27+ group : 'Group ' ,
28+ global_field : 'Global ' ,
29+ blocks : 'ModularBlocks ' ,
30+ link : 'Link ' ,
3131 bullet : 'Bullet' ,
32- custom : 'CustomSmall ' ,
33- tag : 'TagSmall ' ,
34- experience_container : 'PersonalizationLogoGreySmall '
32+ custom : 'Custom ' ,
33+ tag : 'Tag ' ,
34+ extension : 'Extension '
3535 } ;
3636
3737 if (
38- field ?. contentstackFieldType === 'Single Line Textbox' ||
39- field ?. contentstackFieldType === 'single_line_text'
38+ field ?. contentstackFieldType === 'text'
4039 ) {
4140 return icons [ 'title' ] ;
4241 }
4342
44- if ( field ?. contentstackFieldType === 'URL' || field ?. contentstackFieldType === 'url' ) {
43+ if ( field ?. contentstackFieldType === 'url' ) {
44+ return icons [ 'text' ] ;
45+ }
46+ if ( field ?. contentstackFieldType === 'single_line_text' ) {
4547 return icons [ 'text' ] ;
4648 }
4749
@@ -58,14 +60,11 @@ const getTopLevelIcons = (field: FieldMapType) => {
5860 return icons [ 'select' ] ;
5961 }
6062
61- if ( field ?. contentstackFieldType === 'Date ' ) {
63+ if ( field ?. contentstackFieldType === 'isodate ' ) {
6264 return icons [ 'isodate' ] ;
6365 }
6466
65- if (
66- field ?. contentstackFieldType === 'Multi Line Textbox' ||
67- field ?. contentstackFieldType === 'multi_line_text'
68- ) {
67+ if ( field ?. contentstackFieldType === 'multi_line_text' ) {
6968 return icons [ 'multitext' ] ;
7069 }
7170
@@ -76,12 +75,12 @@ const getTopLevelIcons = (field: FieldMapType) => {
7675 return icons [ 'rte' ] ;
7776 }
7877
79- if (
80- field ?. contentstackFieldType === 'JSON Rich Text Editor' ||
81- field ?. contentstackFieldType === 'json'
82- ) {
78+ if ( field ?. contentstackFieldType === 'json' ) {
8379 return icons [ 'jsonRte' ] ;
8480 }
81+ if ( field ?. contentstackFieldType === 'file' ) {
82+ return icons [ 'file' ] ;
83+ }
8584
8685 if ( field ?. contentstackFieldType === 'Link' ) {
8786 return icons [ 'link' ] ;
@@ -99,6 +98,14 @@ const getTopLevelIcons = (field: FieldMapType) => {
9998 return icons [ 'blocks' ] ;
10099 }
101100
101+ if ( field ?. contentstackFieldType === 'app' ) {
102+ return icons [ 'custom' ] ;
103+ }
104+
105+ if ( field ?. contentstackFieldType === 'extension' ) {
106+ return icons [ 'extension' ] ;
107+ }
108+
102109 return icons [ field ?. contentstackFieldType as keyof Icons ] ;
103110} ;
104111
@@ -180,7 +187,7 @@ const TreeView = ({ schema = [] }: schemaType) => {
180187 { hasNestedValue ( field ) && (
181188 < Icon className = { `chevron ${ index ? '' : 'close' } ` } icon = "ChevronExtraSmall" />
182189 ) }
183- < Icon icon = { getTopLevelIcons ( field ) as string } className = "field-icon" />
190+ < Icon icon = { getTopLevelIcons ( field ) as string } className = "field-icon" version = 'v2' size = 'small' />
184191 </ span >
185192 < span className = "field-title" >
186193 { getChildFieldName ( field ?. otherCmsField , item ?. otherCmsField ) }
@@ -222,7 +229,7 @@ const TreeView = ({ schema = [] }: schemaType) => {
222229 >
223230 < span className = { `icons ${ hasNested ? 'nested' : '' } ` } >
224231 { hasNested && < Icon className = { 'chevron' } icon = "ChevronExtraSmall" /> }
225- < Icon className = { 'fieldicon' } icon = { getTopLevelIcons ( item ) as string } />
232+ < Icon className = { 'fieldicon' } icon = { getTopLevelIcons ( item ) as string } version = 'v2' size = 'small' />
226233 </ span >
227234 < span className = { `field-title` } > { item ?. otherCmsField } </ span >
228235 </ button >
0 commit comments