From 7498923df2ad8c5ada9a658cae8489b759d45ef1 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Mon, 28 Sep 2020 21:05:09 -0400 Subject: [PATCH] leap: use indigo-react icons --- pkg/interface/src/logic/lib/omnibox.js | 2 +- .../views/components/leap/OmniboxResult.js | 131 ++++++------------ 2 files changed, 41 insertions(+), 92 deletions(-) diff --git a/pkg/interface/src/logic/lib/omnibox.js b/pkg/interface/src/logic/lib/omnibox.js index 94b23f177..429d7414c 100644 --- a/pkg/interface/src/logic/lib/omnibox.js +++ b/pkg/interface/src/logic/lib/omnibox.js @@ -68,7 +68,7 @@ const appIndex = function (apps) { }); // add groups separately applications.push( - result('Groups', '/~groups', 'groups', null) + result('Groups', '/~groups', 'Groups', null) ); return applications; }; diff --git a/pkg/interface/src/views/components/leap/OmniboxResult.js b/pkg/interface/src/views/components/leap/OmniboxResult.js index 7d60a5245..e03c4d3b1 100644 --- a/pkg/interface/src/views/components/leap/OmniboxResult.js +++ b/pkg/interface/src/views/components/leap/OmniboxResult.js @@ -26,43 +26,20 @@ export class OmniboxResult extends Component { } getIcon(icon, dark, selected, link) { - // graphicStyle is only necessary for pngs - // - //TODO can be removed after indigo-react 1.2 - //which includes icons for apps - let graphicStyle = {}; - - if (icon.toLowerCase() !== 'dojo') { - graphicStyle = (!dark && this.state.hovered) || - selected === link || - (dark && !(this.state.hovered || selected === link)) - ? { filter: 'invert(1)' } - : { filter: 'invert(0)' }; - } else { - graphicStyle = - (!dark && this.state.hovered) || - selected === link || - (dark && !(this.state.hovered || selected === link)) - ? { filter: 'invert(0)' } - : { filter: 'invert(1)' }; - } - - const iconFill = this.state.hovered || selected === link ? 'white' : 'black'; - const sigilFill = this.state.hovered || selected === link ? '#3a8ff7' : '#ffffff'; + const iconFill = (this.state.hovered || (selected === link)) ? 'white' : 'black'; + const sigilFill = (this.state.hovered || (selected === link)) ? '#3a8ff7' : '#ffffff'; let graphic =
; if (defaultApps.includes(icon.toLowerCase()) || icon.toLowerCase() === 'links') { - graphic = - ; + icon = (icon === 'Dojo') ? 'ChevronEast' : icon; + icon = (icon === 'Link') ? 'Links' : icon; + graphic = ; } else if (icon === 'logout') { - graphic = ; + graphic = ; } else if (icon === 'profile') { graphic = ; } else { - graphic = ; + graphic = ; } return graphic; @@ -78,68 +55,40 @@ export class OmniboxResult extends Component { const graphic = this.getIcon(icon, dark, selected, link); return ( - this.setHover(true)} - onMouseLeave={() => this.setHover(false)} - backgroundColor={ - this.state.hovered || selected === link ? 'blue' : 'white' - } - onClick={navigate} - width="100%" - ref={this.result} + this.setHover(true)} + onMouseLeave={() => this.setHover(false)} + backgroundColor={ + this.state.hovered || selected === link ? 'blue' : 'white' + } + onClick={navigate} + width="100%" + ref={this.result} + > + {graphic} + - {this.state.hovered || selected === link ? ( - <> - {graphic} - - {text} - - - {subtext} - - - ) : ( - <> - {graphic} - - {text} - - - {subtext} - - - )} - + {text} + + + {subtext} + + ); } }