Skip to content

Commit

Permalink
debugtools #15: removed filter
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLeoni committed Aug 22, 2020
1 parent 42b30a5 commit bf22dd6
Showing 1 changed file with 42 additions and 37 deletions.
79 changes: 42 additions & 37 deletions src/components/botch/botch-life-tree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,47 @@ class BotchLifeTree extends React.Component {
onSelect={this.handleSelect}
/>);
}

renderFilter (){
return (this.props.filterable || this.props.tags) && (
<div className={styles.filterBar}>
{this.props.filterable && (
<Filter
className={classNames(
styles.filterBarItem,
styles.filter
)}
filterQuery={this.state.filterQuery}
inputClassName={styles.filterInput}
placeholderText={this.props.intl.formatMessage(messages.filterPlaceholder)}
onChange={this.handleFilterChange}
onClear={this.handleFilterClear}
/>
)}
{this.props.filterable && this.props.tags && (
<Divider className={classNames(styles.filterBarItem, styles.divider)} />
)}
{this.props.tags &&
<div className={styles.tagWrapper}>
{tagListPrefix.concat(this.props.tags).map((tagProps, id) => (
<TagButton
active={this.state.selectedTag === tagProps.tag.toLowerCase()}
className={classNames(
styles.filterBarItem,
styles.tagButton,
tagProps.className
)}
key={`tag-button-${id}`}
onClick={this.handleTagClick}
{...tagProps}
/>
))}
</div>
}
</div>
);
}

render () {


Expand All @@ -252,43 +293,7 @@ class BotchLifeTree extends React.Component {
onRequestClose={this.handleClose}
>*/
<div>
{(this.props.filterable || this.props.tags) && (
<div className={styles.filterBar}>
{this.props.filterable && (
<Filter
className={classNames(
styles.filterBarItem,
styles.filter
)}
filterQuery={this.state.filterQuery}
inputClassName={styles.filterInput}
placeholderText={this.props.intl.formatMessage(messages.filterPlaceholder)}
onChange={this.handleFilterChange}
onClear={this.handleFilterClear}
/>
)}
{this.props.filterable && this.props.tags && (
<Divider className={classNames(styles.filterBarItem, styles.divider)} />
)}
{this.props.tags &&
<div className={styles.tagWrapper}>
{tagListPrefix.concat(this.props.tags).map((tagProps, id) => (
<TagButton
active={this.state.selectedTag === tagProps.tag.toLowerCase()}
className={classNames(
styles.filterBarItem,
styles.tagButton,
tagProps.className
)}
key={`tag-button-${id}`}
onClick={this.handleTagClick}
{...tagProps}
/>
))}
</div>
}
</div>
)}

{this.renderTree()}
</div>
);
Expand Down

0 comments on commit bf22dd6

Please sign in to comment.