mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-22 07:59:22 +03:00
omniboxresult: add catch for dojo's graphic
This commit is contained in:
parent
1be4aed640
commit
1c567ad4d9
@ -18,13 +18,26 @@ export class OmniboxResult extends Component {
|
|||||||
render() {
|
render() {
|
||||||
const { icon, text, subtext, link, navigate, selected, dark } = this.props;
|
const { icon, text, subtext, link, navigate, selected, dark } = this.props;
|
||||||
|
|
||||||
const invertGraphic = ((!dark && this.state.hovered || selected === link) || (dark && !(this.state.hovered || selected === link)))
|
let invertGraphic = {};
|
||||||
? { filter: 'invert(1)' }
|
|
||||||
: { filter: 'invert(0)' };
|
if (icon.toLowerCase() !== 'dojo') {
|
||||||
|
invertGraphic = (!dark && this.state.hovered) ||
|
||||||
|
selected === link ||
|
||||||
|
(dark && !(this.state.hovered || selected === link))
|
||||||
|
? { filter: "invert(1)" }
|
||||||
|
: { filter: "invert(0)" };
|
||||||
|
} else {
|
||||||
|
invertGraphic =
|
||||||
|
(!dark && this.state.hovered) ||
|
||||||
|
selected === link ||
|
||||||
|
(dark && !(this.state.hovered || selected === link))
|
||||||
|
? { filter: "invert(0)" }
|
||||||
|
: { filter: "invert(1)" };
|
||||||
|
}
|
||||||
|
|
||||||
let graphic = <div />;
|
let graphic = <div />;
|
||||||
if (defaultApps.includes(icon.toLowerCase())) {
|
if (defaultApps.includes(icon.toLowerCase())) {
|
||||||
graphic = <img className="invert-d mr2 v-mid" height="12" width="12" src={`/~landscape/img/${icon.toLowerCase()}.png`} style={invertGraphic} />;
|
graphic = <img className="mr2 v-mid" height="12" width="12" src={`/~landscape/img/${icon.toLowerCase()}.png`} style={invertGraphic} />;
|
||||||
} else {
|
} else {
|
||||||
graphic = <Icon />;
|
graphic = <Icon />;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user