Adds mainPage to hass-tabs-subpage (#5724)

This commit is contained in:
Joakim Sørensen 2020-05-02 20:19:17 +02:00 committed by GitHub
parent 8f2a7c95b3
commit 108233f3b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 5 deletions

View File

@ -88,6 +88,7 @@ class HassioAddonStore extends LitElement {
.narrow=${this.narrow} .narrow=${this.narrow}
.route=${this.route} .route=${this.route}
hassio hassio
main-page
.tabs=${supervisorTabs} .tabs=${supervisorTabs}
> >
<span slot="header">Add-on store</span> <span slot="header">Add-on store</span>

View File

@ -40,6 +40,7 @@ class HassioDashboard extends LitElement {
.hass=${this.hass} .hass=${this.hass}
.narrow=${this.narrow} .narrow=${this.narrow}
hassio hassio
main-page
.route=${this.route} .route=${this.route}
.tabs=${supervisorTabs} .tabs=${supervisorTabs}
> >

View File

@ -92,6 +92,7 @@ class HassioSnapshots extends LitElement {
.hass=${this.hass} .hass=${this.hass}
.narrow=${this.narrow} .narrow=${this.narrow}
hassio hassio
main-page
.route=${this.route} .route=${this.route}
.tabs=${supervisorTabs} .tabs=${supervisorTabs}
> >

View File

@ -43,6 +43,7 @@ class HassioSystem extends LitElement {
.hass=${this.hass} .hass=${this.hass}
.narrow=${this.narrow} .narrow=${this.narrow}
hassio hassio
main-page
.route=${this.route} .route=${this.route}
.tabs=${supervisorTabs} .tabs=${supervisorTabs}
> >

View File

@ -39,6 +39,8 @@ class HassTabsSubpage extends LitElement {
@property({ type: Boolean }) public hassio = false; @property({ type: Boolean }) public hassio = false;
@property({ type: Boolean, attribute: "main-page" }) public mainPage = false;
@property() public route!: Route; @property() public route!: Route;
@property() public tabs!: PageNavigation[]; @property() public tabs!: PageNavigation[];
@ -114,11 +116,21 @@ class HassTabsSubpage extends LitElement {
return html` return html`
<div class="toolbar"> <div class="toolbar">
<ha-paper-icon-button-arrow-prev ${this.mainPage
aria-label="Back" ? html`
.hassio=${this.hassio} <ha-menu-button
@click=${this._backTapped} .hass=${this.hass}
></ha-paper-icon-button-arrow-prev> .hassio=${this.hassio}
.narrow=${this.narrow}
></ha-menu-button>
`
: html`
<ha-paper-icon-button-arrow-prev
aria-label="Back"
.hassio=${this.hassio}
@click=${this._backTapped}
></ha-paper-icon-button-arrow-prev>
`}
${this.narrow ${this.narrow
? html` <div class="main-title"><slot name="header"></slot></div> ` ? html` <div class="main-title"><slot name="header"></slot></div> `
: ""} : ""}