Skip to content

Commit 68471dc

Browse files
authored
Merge pull request #68 from ShlomoPorges/development
Show on tab number of props & html elements
2 parents 5e9b75e + bba5e45 commit 68471dc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/RightTabs.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ class RightTabs extends Component {
133133
} = this.props;
134134
const { value } = this.state;
135135

136+
// display count on the tab. user can see without clicking into tab
137+
const propCount = focusComponent.props.length
138+
const htmlAttribCount = focusComponent.childrenArray.filter( child => child.childType === 'HTML').length
139+
140+
// const counters = focusComponent.ch
136141
const tree = {
137142
name: focusComponent.title,
138143
attributes: {},
@@ -154,7 +159,7 @@ class RightTabs extends Component {
154159
<Tab
155160
disableRipple
156161
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
157-
label="Component Props"
162+
label={`Component Props ${ propCount ? '('+propCount+')' : '' } ` }
158163
/>
159164
<Tab
160165
disableRipple
@@ -164,7 +169,7 @@ class RightTabs extends Component {
164169
<Tab
165170
disableRipple
166171
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
167-
label="HTML Element Attributes"
172+
label={`HTML Element Attributes ${ htmlAttribCount ? '('+htmlAttribCount+')' : '' } ` }
168173
/>
169174
</Tabs>
170175

0 commit comments

Comments
 (0)