Skip to content
Snippets Groups Projects
Commit a0060e3a authored by Tom Robinson's avatar Tom Robinson
Browse files

Make label icon appear when popover is open

parent da75107d
No related branches found
No related tags found
No related merge requests found
......@@ -44,12 +44,14 @@ export default ComposedComponent => class extends Component {
}
render() {
const { triggerElement, triggerClasses, triggerClassesOpen } = this.props;
const { isOpen } = this.state;
return (
<a ref="trigger" onClick={() => this.toggle()} className={cx("no-decoration", this.props.triggerClasses)}>
{this.props.triggerElement}
<a ref="trigger" onClick={() => this.toggle()} className={cx("no-decoration", triggerClasses, isOpen ? triggerClassesOpen : null)}>
{triggerElement}
<ComposedComponent
{...this.props}
isOpen={this.state.isOpen}
isOpen={isOpen}
onClose={this.onClose.bind(this)}
target={() => this.target()}
/>
......
......@@ -32,9 +32,12 @@ const Item = ({ id, name, created, by, selected, favorite, archived, icon, label
<div className={S.rightIcons}>
<LabelPopover
triggerElement={<Icon className={S.tagIcon} name="grid" width={20} height={20} />}
triggerClassesOpen={S.open}
item={{ id, labels }}
/>
<Icon className={S.favoriteIcon} name="star" width={20} height={20} onClick={() => setFavorited(id, !favorite) }/>
<Tooltip tooltip="Favorite">
<Icon className={S.favoriteIcon} name="star" width={20} height={20} onClick={() => setFavorited(id, !favorite) }/>
</Tooltip>
</div>
<div className={S.extraIcons}>
<Tooltip tooltip="Archive">
......
......@@ -108,6 +108,10 @@
composes: icon;
composes: mx1 from "style/spacing";
}
:local(.open) :local(.tagIcon) {
visibility: visible;
color: var(--blue-color);
}
/* FAVORITE */
:local(.favoriteIcon) {
......
......@@ -20,11 +20,9 @@ const mapDispatchToProps = {
@connect(mapStateToProps, mapDispatchToProps)
export default class LabelPopover extends Component {
render() {
const { triggerElement, labels, setLabeled, item, count } = this.props;
const { labels, setLabeled, item, count } = this.props;
return (
<PopoverWithTrigger
triggerElement={triggerElement}
>
<PopoverWithTrigger {...this.props}>
{ () =>
<LabelPicker labels={labels} setLabeled={setLabeled} item={item} count={count} />
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment