Skip to content

Commit

Permalink
👽 Switch to new ha-icon component (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkih committed May 19, 2020
1 parent fa1427d commit 2809dc5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ class MiniMediaPlayerDropdown extends LitElement {
<span class='mmp-dropdown__label ellipsis'>
${this.selected || this.label}
</span>
<iron-icon class='mmp-dropdown__icon' .icon=${ICON.DROPDOWN}></iron-icon>
<ha-icon class='mmp-dropdown__icon' .icon=${ICON.DROPDOWN}></ha-icon>
</div>
</mmp-button>
`}
<paper-listbox slot="dropdown-content" .selected=${this.selectedId} @iron-select=${this.onChange}>
${this.items.map(item => html`
<paper-item value=${item.id || item.name}>
${item.icon ? html`<iron-icon .icon=${item.icon}></iron-icon>` : ''}
${item.icon ? html`<ha-icon .icon=${item.icon}></ha-icon>` : ''}
${item.name ? html`<span class='mmp-dropdown__item__label'>${item.name}</span>` : ''}
</paper-item>`)}
</paper-listbox>
Expand Down Expand Up @@ -121,7 +121,7 @@ class MiniMediaPlayerDropdown extends LitElement {
paper-item > *:nth-child(2) {
margin-left: 4px;
}
paper-menu-button[focused] mmp-button iron-icon {
paper-menu-button[focused] mmp-button ha-icon {
color: var(--mmp-accent-color);
transform: rotate(180deg);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class MiniMediaPlayerShortcuts extends LitElement {
class='mmp-shortcuts__button'
@click=${e => this.handleShortcut(e, item)}>
<div align=${this.shortcuts.align_text}>
${item.icon ? html`<iron-icon .icon=${item.icon}></iron-icon>` : ''}
${item.icon ? html`<ha-icon .icon=${item.icon}></ha-icon>` : ''}
${item.image ? html`<img src=${item.image}>` : ''}
${item.name ? html`<span class="ellipsis">${item.name}</span>` : ''}
</div>
Expand Down Expand Up @@ -134,7 +134,7 @@ class MiniMediaPlayerShortcuts extends LitElement {
line-height: calc(var(--mmp-unit) * .6);
text-transform: initial;
}
.mmp-shortcuts__button > div > iron-icon {
.mmp-shortcuts__button > div > ha-icon {
width: calc(var(--mmp-unit) * .6);
height: calc(var(--mmp-unit) * .6);
}
Expand Down
7 changes: 7 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ if (!customElements.get('ha-icon-button')) {
);
}

if (!customElements.get('ha-icon')) {
customElements.define(
'ha-icon',
class extends customElements.get('iron-icon') {},
);
}

class MiniMediaPlayer extends LitElement {
constructor() {
super();
Expand Down

0 comments on commit 2809dc5

Please sign in to comment.