Fix layout of domain toggler dialog (#6771)

This commit is contained in:
Bram Kragten 2020-09-02 20:46:38 +02:00 committed by GitHub
parent 8e506f7749
commit 57763ef032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,8 +10,8 @@ import {
} from "lit-element"; } from "lit-element";
import { fireEvent } from "../../common/dom/fire_event"; import { fireEvent } from "../../common/dom/fire_event";
import { createCloseHeading } from "../../components/ha-dialog"; import { createCloseHeading } from "../../components/ha-dialog";
import "../../components/ha-switch";
import "../../components/ha-formfield"; import "../../components/ha-formfield";
import "../../components/ha-switch";
import { domainToName } from "../../data/integration"; import { domainToName } from "../../data/integration";
import { haStyleDialog } from "../../resources/styles"; import { haStyleDialog } from "../../resources/styles";
import { HomeAssistant } from "../../types"; import { HomeAssistant } from "../../types";
@ -59,16 +59,18 @@ class DomainTogglerDialog extends LitElement implements HassDialog {
(domain) => (domain) =>
html` html`
<ha-formfield .label=${domain[0]}> <ha-formfield .label=${domain[0]}>
<ha-switch <ha-switch
.domain=${domain[1]} .domain=${domain[1]}
.checked=${!this._params!.exposedDomains || .checked=${!this._params!.exposedDomains ||
this._params!.exposedDomains.includes(domain[1])} this._params!.exposedDomains.includes(domain[1])}
@change=${this._handleSwitch} @change=${this._handleSwitch}
> >
</ha-switch> </ha-switch>
</ha-formfield> </ha-formfield>
<mwc-button .domain=${domain[1]} @click=${this._handleReset}> <mwc-button .domain=${domain[1]} @click=${this._handleReset}>
${this.hass.localize("ui.dialogs.domain_toggler.reset_entities")} ${this.hass.localize(
"ui.dialogs.domain_toggler.reset_entities"
)}
</mwc-button> </mwc-button>
` `
)} )}
@ -96,7 +98,8 @@ class DomainTogglerDialog extends LitElement implements HassDialog {
} }
div { div {
display: grid; display: grid;
grid-template-columns: auto auto auto; grid-template-columns: auto auto;
grid-row-gap: 8px;
align-items: center; align-items: center;
} }
`, `,