|
1 | | -import { customElement, property } from '@polymer/decorators'; |
2 | | -import { html, PolymerElement } from '@polymer/polymer'; |
| 1 | +import { css, html } from 'lit'; |
| 2 | +import { customElement, property } from 'lit/decorators.js'; |
| 3 | +import { repeat } from 'lit/directives/repeat.js'; |
3 | 4 | import { footerRelBlock, notifications, subscribeNote } from '../utils/data'; |
4 | | -import './subscribe-form-footer'; |
| 5 | +import { ThemedElement } from '../components/themed-element'; |
| 6 | +import '../elements/subscribe-form-footer'; |
5 | 7 |
|
6 | 8 | @customElement('footer-rel') |
7 | | -export class FooterRel extends PolymerElement { |
8 | | - static get template() { |
9 | | - return html` |
10 | | - <style include="shared-styles flex flex-alignment"> |
| 9 | +export class FooterRel extends ThemedElement { |
| 10 | + static override get styles() { |
| 11 | + return [ |
| 12 | + ...super.styles, |
| 13 | + css` |
11 | 14 | :host { |
12 | 15 | border-top: 1px solid var(--border-light-color); |
13 | 16 | border-bottom: 1px solid var(--border-light-color); |
@@ -63,38 +66,51 @@ export class FooterRel extends PolymerElement { |
63 | 66 | margin-top: 0; |
64 | 67 | } |
65 | 68 | } |
66 | | - </style> |
| 69 | + `, |
| 70 | + ]; |
| 71 | + } |
67 | 72 |
|
68 | | - <template is="dom-repeat" items="[[footerRelBlock]]" as="footerRel"> |
69 | | - <div class="col" layout vertical wrap flex-auto> |
70 | | - <div class="col-heading">[[footerRel.title]]</div> |
71 | | - <ul class="nav"> |
72 | | - <template is="dom-repeat" items="[[footerRel.links]]" as="link"> |
73 | | - <li> |
74 | | - <template is="dom-if" if="[[!link.newTab]]"> |
75 | | - <a href="[[link.url]]">[[link.name]]</a> |
76 | | - </template> |
77 | | - <template is="dom-if" if="[[link.newTab]]"> |
78 | | - <a href="[[link.url]]" target="_blank" rel="noopener noreferrer">[[link.name]]</a> |
79 | | - </template> |
80 | | - </li> |
81 | | - </template> |
82 | | - </ul> |
83 | | - </div> |
84 | | - </template> |
| 73 | + override render() { |
| 74 | + return html` |
| 75 | + ${repeat( |
| 76 | + this.footerRelBlock, |
| 77 | + (footerRel) => footerRel.title, |
| 78 | + (footerRel) => html` |
| 79 | + <div class="col" layout vertical wrap flex-auto> |
| 80 | + <div class="col-heading">${footerRel.title}</div> |
| 81 | + <ul class="nav"> |
| 82 | + ${repeat( |
| 83 | + footerRel.links, |
| 84 | + (link) => link.url, |
| 85 | + (link) => html` |
| 86 | + <li> |
| 87 | + ${link.newTab |
| 88 | + ? html`<a href="${link.url}" target="_blank" rel="noopener noreferrer" |
| 89 | + >${link.name}</a |
| 90 | + >` |
| 91 | + : html`<a href="${link.url}">${link.name}</a>`} |
| 92 | + </li> |
| 93 | + `, |
| 94 | + )} |
| 95 | + </ul> |
| 96 | + </div> |
| 97 | + `, |
| 98 | + )} |
85 | 99 |
|
86 | 100 | <div class="col" layout vertical flex-auto wrap> |
87 | | - <div class="col-heading">[[notifications.subscribe]]</div> |
88 | | - <span>[[subscribeNote]]</span> |
| 101 | + <div class="col-heading">${this.notifications.subscribe}</div> |
| 102 | + <span>${this.subscribeNote}</span> |
89 | 103 | <subscribe-form-footer></subscribe-form-footer> |
90 | 104 | </div> |
91 | 105 | `; |
92 | 106 | } |
93 | 107 |
|
94 | 108 | @property({ type: Array }) |
95 | 109 | private footerRelBlock = footerRelBlock; |
| 110 | + |
96 | 111 | @property() |
97 | 112 | private subscribeNote = subscribeNote; |
| 113 | + |
98 | 114 | @property({ type: Object }) |
99 | 115 | private notifications = notifications; |
100 | 116 | } |
0 commit comments