Visual alignment of automation and script more info dialogs (#8234)

This commit is contained in:
Philip Allgaier 2021-01-26 10:25:34 +01:00 committed by GitHub
parent cf43b26e14
commit 0a09ec706f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 5 deletions

View File

@ -57,7 +57,9 @@ class MoreInfoAutomation extends LitElement {
} }
.actions { .actions {
margin: 8px 0; margin: 8px 0;
text-align: right; display: flex;
flex-wrap: wrap;
justify-content: center;
} }
`; `;
} }

View File

@ -1,5 +1,7 @@
import { HassEntity } from "home-assistant-js-websocket"; import { HassEntity } from "home-assistant-js-websocket";
import { import {
css,
CSSResult,
customElement, customElement,
html, html,
LitElement, LitElement,
@ -21,10 +23,12 @@ class MoreInfoScript extends LitElement {
} }
return html` return html`
<div class="flex">
<div> <div>
${this.hass.localize( ${this.hass.localize(
"ui.dialogs.more_info_control.script.last_triggered" "ui.dialogs.more_info_control.script.last_triggered"
)}: )}:
</div>
${this.stateObj.attributes.last_triggered ${this.stateObj.attributes.last_triggered
? html` ? html`
<ha-relative-time <ha-relative-time
@ -36,6 +40,15 @@ class MoreInfoScript extends LitElement {
</div> </div>
`; `;
} }
static get styles(): CSSResult {
return css`
.flex {
display: flex;
justify-content: space-between;
}
`;
}
} }
declare global { declare global {