Skip to content

Show on tab number of props & html elements #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/RightTabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ class RightTabs extends Component {
} = this.props;
const { value } = this.state;

// display count on the tab. user can see without clicking into tab
const propCount = focusComponent.props.length
const htmlAttribCount = focusComponent.childrenArray.filter( child => child.childType === 'HTML').length

// const counters = focusComponent.ch
const tree = {
name: focusComponent.title,
attributes: {},
Expand All @@ -154,7 +159,7 @@ class RightTabs extends Component {
<Tab
disableRipple
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
label="Component Props"
label={`Component Props ${ propCount ? '('+propCount+')' : '' } ` }
/>
<Tab
disableRipple
Expand All @@ -164,7 +169,7 @@ class RightTabs extends Component {
<Tab
disableRipple
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
label="HTML Element Attributes"
label={`HTML Element Attributes ${ htmlAttribCount ? '('+htmlAttribCount+')' : '' } ` }
/>
</Tabs>

Expand Down