Skip to content

Commit d8277af

Browse files
authored
Merge pull request #5 from jesmak/master
Migrating from Polymer to Lit
2 parents 3cf1058 + 468477e commit d8277af

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

github-entity-row.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
class GithubEntityRow extends Polymer.Element {
1+
import { html, LitElement } from 'https://unpkg.com/lit-element@2.0.1/lit-element.js?module';
22

3-
static get template() {
4-
return Polymer.html`
3+
class GithubEntityRow extends LitElement {
4+
5+
static get properties() {
6+
return {
7+
_hass: {},
8+
_config: {},
9+
};
10+
}
11+
12+
render() {
13+
return html`
514
<style>
615
.flex {
716
display: flex;
@@ -21,19 +30,19 @@ class GithubEntityRow extends Polymer.Element {
2130
color: var(--primary-color);
2231
}
2332
</style>
24-
<hui-generic-entity-row hass="[[_hass]]" config="[[_config]]">
33+
<hui-generic-entity-row .hass="${this._hass}" .config="${this._config}">
2534
<div class="flex">
26-
<div class="entity" on-click="issues" title="Open issues">
35+
<div class="entity" @click="${this.issues}" title="Open issues">
2736
<ha-icon class="icon" icon="mdi:alert-circle-outline"></ha-icon>
28-
<span>[[stateObjIssues.state]]</span>
37+
<span>${this.stateObjIssues.state}</span>
2938
</div>
30-
<div class="entity" on-click="pulls" title="Open pull requests">
39+
<div class="entity" @click="${this.pulls}" title="Open pull requests">
3140
<ha-icon class="icon" icon="mdi:source-pull"></ha-icon>
32-
<span>[[stateObjPRs.state]]</span>
41+
<span>${this.stateObjPRs.state}</span>
3342
</div>
34-
<div class="entity" on-click="stars" title="Stargazers">
43+
<div class="entity" @click="${this.stars}" title="Stargazers">
3544
<ha-icon class="icon" icon="mdi:star"></ha-icon>
36-
<span>[[stateObjStars.state]]</span>
45+
<span>${this.stateObjStars.state}</span>
3746
</div>
3847
</div>
3948
</hui-generic-entity-row>

0 commit comments

Comments
 (0)