Skip to content

Commit

Permalink
Fix icon
Browse files Browse the repository at this point in the history
  • Loading branch information
iantrich committed Nov 4, 2021
1 parent ae15fdf commit 022769b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/roku-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ export class RokuCard extends LitElement {
padding: 16px 0px 16px 0px;
}
img,
ha-icon-button {
ha-icon {
cursor: pointer;
}
ha-icon-button {
ha-icon {
--mdc-icon-button-size: 64px;
--mdc-icon-size: 48px;
}
Expand Down Expand Up @@ -171,15 +171,16 @@ export class RokuCard extends LitElement {
? html`
<ha-icon-button
.app=${this._config.apps[index].app}
.icon=${this._config.apps[index].icon}
.title=${this._config.apps[index].app}
.config=${this._config.apps[index]}
@action=${this._handleAction}
.actionHandler=${actionHandler({
hasHold: hasAction(this._config.apps[index].hold_action),
hasDoubleClick: hasAction(this._config.apps[index].double_tap_action),
})}
></ha-icon-button>
>
<ha-icon .icon=${this._config.apps[index].icon}></ha-icon>
</ha-icon-button>
`
: html`
<img
Expand All @@ -194,7 +195,7 @@ export class RokuCard extends LitElement {
/>
`
: html`
<ha-icon-button></ha-icon-button>
<ha-icon icon="mdi:none"></ha-icon>
`;
}

Expand All @@ -203,26 +204,28 @@ export class RokuCard extends LitElement {
const config = this._config[button];
return config && config.show === false
? html`
<ha-icon-button></ha-icon-button>
<ha-icon icon="mdi:none"></ha-icon>
`
: html`
<ha-icon-button
.button=${button}
icon=${icon}
title=${title}
@action=${this._handleAction}
.actionHandler=${actionHandler({
hasHold: config && hasAction(config.hold_action),
hasDoubleClick: config && hasAction(config.double_tap_action),
})}
></ha-icon-button>
>
<ha-icon .icon=${icon}></ha-icon>
</ha-icon-button>
`;
} else {
return html``;
}
}

private _handleAction(ev): void {
console.log('click');
if (this.hass && this._config && ev.detail.action) {
const button = ev.currentTarget.button;
const config = this._config[button] || ev.currentTarget.config;
Expand Down

0 comments on commit 022769b

Please sign in to comment.