mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 04:06:35 +00:00
Add icons to integration page (#5388)
This commit is contained in:
parent
ddeb16463d
commit
2e17c96866
@ -200,6 +200,15 @@ export class HaConfigManagerDashboard extends LitElement {
|
||||
href="/config/integrations/config_entry/${item.entry_id}"
|
||||
>
|
||||
<paper-item data-index=${idx}>
|
||||
<img
|
||||
src="https://brands.home-assistant.io/${item.domain}/icon.png"
|
||||
srcset="
|
||||
https://brands.home-assistant.io/${item.domain}/icon@2x.png 2x
|
||||
"
|
||||
referrerpolicy="no-referrer"
|
||||
@error=${this._onImageError}
|
||||
@load=${this._onImageLoad}
|
||||
/>
|
||||
<paper-item-body two-line>
|
||||
<div>
|
||||
${this.hass.localize(
|
||||
@ -342,6 +351,14 @@ export class HaConfigManagerDashboard extends LitElement {
|
||||
return states;
|
||||
}
|
||||
|
||||
private _onImageLoad(ev) {
|
||||
ev.target.style.visibility = "initial";
|
||||
}
|
||||
|
||||
private _onImageError(ev) {
|
||||
ev.target.style.visibility = "hidden";
|
||||
}
|
||||
|
||||
static get styles(): CSSResult {
|
||||
return css`
|
||||
mwc-button {
|
||||
@ -355,6 +372,9 @@ export class HaConfigManagerDashboard extends LitElement {
|
||||
cursor: pointer;
|
||||
margin: 8px;
|
||||
}
|
||||
.configured {
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
.configured a {
|
||||
color: var(--primary-text-color);
|
||||
text-decoration: none;
|
||||
@ -375,6 +395,10 @@ export class HaConfigManagerDashboard extends LitElement {
|
||||
.overflow {
|
||||
width: 56px;
|
||||
}
|
||||
img {
|
||||
width: 50px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user