Hide read button when selecting saved items
This commit is contained in:
parent
5bec9ce5ee
commit
eb4ad8612b
1 changed files with 6 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import { isEqual } from 'lodash';
|
||||||
|
|
||||||
import { filterCategories, filterRules } from './filters.js';
|
import { filterCategories, filterRules } from './filters.js';
|
||||||
|
|
||||||
|
import { CATEGORY_TYPE, RULE_TYPE } from '../../constants.js';
|
||||||
import LoadingIndicator from '../../../../components/LoadingIndicator.js';
|
import LoadingIndicator from '../../../../components/LoadingIndicator.js';
|
||||||
import CategoryItem from './CategoryItem.js';
|
import CategoryItem from './CategoryItem.js';
|
||||||
import SavedItem from './SavedItem.js';
|
import SavedItem from './SavedItem.js';
|
||||||
|
|
@ -27,6 +28,10 @@ class Sidebar extends React.Component {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const showReadButton =
|
||||||
|
this.props.selected.item &&
|
||||||
|
[CATEGORY_TYPE, RULE_TYPE].includes(this.props.selected.item.type);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="sidebar">
|
<div className="sidebar">
|
||||||
{(this.props.categories.isFetching || this.props.rules.isFetching) && (
|
{(this.props.categories.isFetching || this.props.rules.isFetching) && (
|
||||||
|
|
@ -38,7 +43,7 @@ class Sidebar extends React.Component {
|
||||||
{categoryItems}
|
{categoryItems}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{!isEqual(this.props.selected.item, {}) && <ReadButton />}
|
{showReadButton && <ReadButton />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue