From c51754a5e8ac3aa97f47604f11aa7c1135ff97d6 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Tue, 24 Oct 2023 17:51:59 +0200 Subject: [PATCH] Redesign about page --- src/panels/config/info/ha-config-info.ts | 144 +++++++++++++++-------- src/translations/en.json | 2 +- 2 files changed, 95 insertions(+), 51 deletions(-) diff --git a/src/panels/config/info/ha-config-info.ts b/src/panels/config/info/ha-config-info.ts index 2ad19834aeaa..f23ccc115ca7 100644 --- a/src/panels/config/info/ha-config-info.ts +++ b/src/panels/config/info/ha-config-info.ts @@ -7,8 +7,15 @@ import { mdiNewspaperVariant, mdiTshirtCrew, } from "@mdi/js"; -import { CSSResultGroup, LitElement, TemplateResult, css, html } from "lit"; -import { property, state } from "lit/decorators"; +import { + CSSResultGroup, + LitElement, + TemplateResult, + css, + html, + nothing, +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import "../../../components/ha-card"; import "../../../components/ha-clickable-list-item"; @@ -77,6 +84,7 @@ const PAGES = [ iconColor: string; }[]; +@customElement("ha-config-info") class HaConfigInfo extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @@ -105,41 +113,56 @@ class HaConfigInfo extends LitElement { .header=${this.hass.localize("ui.panel.config.info.caption")} >
- -
- + + - - - -
- Home Assistant ${hass.connection.haVersion} - ${this._hassioInfo - ? html`Supervisor ${this._hassioInfo.supervisor}` - : ""} - ${this._osInfo?.version - ? html`Operating System ${this._osInfo.version}` - : ""} - + + +

Home Assistant

+
    +
  • + Core + ${hass.connection.haVersion} +
  • + ${this._hassioInfo + ? html` +
  • + Supervisor + ${this._hassioInfo.supervisor} +
  • + ` + : nothing} + ${this._osInfo + ? html` +
  • + Operating System + ${this._osInfo.version} +
  • + ` + : nothing} +
  • + ${this.hass.localize( - "ui.panel.config.info.frontend_version", - "version", - JS_VERSION, - "type", - JS_TYPE + "ui.panel.config.info.frontend_version_label" )} -
-
+ + ${JS_VERSION}${JS_TYPE !== "latest" ? ` βΈ± ${JS_TYPE}` : ""} + + + +
+ ${PAGES.map( (page) => html` @@ -222,32 +245,62 @@ class HaConfigInfo extends LitElement { } ha-logo-svg { - padding: 12px; - height: 150px; - width: 150px; + height: 56px; + width: 56px; } ha-card { - padding: 16px; max-width: 600px; margin: 0 auto; - margin-bottom: 24px; + margin-bottom: 16px; + padding: 16px; + } + + .pages { margin-bottom: max(24px, env(safe-area-inset-bottom)); } - .logo-versions { + .header { display: flex; - justify-content: flex-start; + flex-direction: column; + justify-content: center; align-items: center; + padding: 32px 8px 16px 8px; + } + + .header p { + font-size: 22px; + font-weight: 400; + line-height: 28px; + text-align: center; + margin: 24px; } .versions { display: flex; flex-direction: column; color: var(--secondary-text-color); - padding: 12px 0; align-self: stretch; justify-content: flex-start; + padding: 0 12px; + margin: 0; + } + + .versions li { + display: flex; + flex-direction: row; + justify-content: space-between; + font-size: 14px; + font-weight: 400; + padding: 4px 0; + } + + .version-label { + color: var(--primary-text-color); + } + + .version { + color: var(--secondary-text-color); } .ha-version { @@ -272,13 +325,6 @@ class HaConfigInfo extends LitElement { border-radius: 50%; } - @media all and (max-width: 500px), all and (max-height: 500px) { - ha-logo-svg { - height: 100px; - width: 100px; - } - } - .custom-ui { color: var(--secondary-text-color); text-align: center; @@ -293,5 +339,3 @@ declare global { "ha-config-info": HaConfigInfo; } } - -customElements.define("ha-config-info", HaConfigInfo); diff --git a/src/translations/en.json b/src/translations/en.json index 7bc526ff7134..9cd6632e3397 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2024,7 +2024,7 @@ "frontend": "frontend-ui", "built_using": "Built using", "icons_by": "Icons by", - "frontend_version": "Frontend {version} - {type}", + "frontend_version_label": "Frontend", "custom_uis": "Custom UIs:", "system_health_error": "System Health component is not loaded. Add 'system_health:' to configuration.yaml", "documentation": "Documentation",