diff --git a/src/hacs-router.ts b/src/hacs-router.ts index ad4a708b4..3bd87ac62 100644 --- a/src/hacs-router.ts +++ b/src/hacs-router.ts @@ -40,6 +40,7 @@ class HacsRouter extends HassRouterPage { this.style.setProperty("--app-header-background-color", "var(--sidebar-background-color)"); this.style.setProperty("--app-header-text-color", "var(--sidebar-text-color)"); this.style.setProperty("--app-header-border-bottom", "1px solid var(--divider-color)"); + this.style.setProperty("--ha-card-border-radius", "var(--ha-config-card-border-radius, 8px)"); } public disconnectedCallback() { diff --git a/src/panels/hacs-entry-panel.ts b/src/panels/hacs-entry-panel.ts index 7cc0b0487..eff2930b3 100644 --- a/src/panels/hacs-entry-panel.ts +++ b/src/panels/hacs-entry-panel.ts @@ -1,4 +1,5 @@ import "@material/mwc-button/mwc-button"; +import "@material/mwc-list/mwc-list"; import { mdiAlertCircle, mdiGithub, mdiHomeAssistant, mdiInformation } from "@mdi/js"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; @@ -9,10 +10,11 @@ import { navigate } from "../../homeassistant-frontend/src/common/navigate"; import { computeRTL } from "../../homeassistant-frontend/src/common/util/compute_rtl"; import "../../homeassistant-frontend/src/components/ha-alert"; import "../../homeassistant-frontend/src/components/ha-card"; +import "../../homeassistant-frontend/src/components/ha-clickable-list-item"; +import "../../homeassistant-frontend/src/components/ha-icon-next"; import "../../homeassistant-frontend/src/components/ha-menu-button"; import "../../homeassistant-frontend/src/components/ha-svg-icon"; import "../../homeassistant-frontend/src/layouts/ha-app-layout"; -import "../../homeassistant-frontend/src/panels/config/dashboard/ha-config-navigation"; import "../../homeassistant-frontend/src/panels/config/ha-config-section"; import { haStyle } from "../../homeassistant-frontend/src/resources/styles"; import { HomeAssistant, Route } from "../../homeassistant-frontend/src/types"; @@ -109,89 +111,115 @@ export class HacsEntryPanel extends LitElement { ${this.hacs.updates?.length !== 0 ? html`
${this.hacs.localize("common.updates")}
- ${sortRepositoriesByName(this.hacs.updates).map( - (repository) => - html` -
this._openUpdateDialog(repository)}> -
- ${repository.category === "integration" - ? html` - - ` - : html` - - - `} -
-
-
${repository.name}
-
- ${this.hacs.localize("sections.pending_repository_upgrade", { - downloaded: repository.installed_version, - available: repository.available_version, - })} -
-
- ${!this.narrow ? html`` : ""} -
+ + ${sortRepositoriesByName(this.hacs.updates).map( + (repository) => html` + this._openUpdateDialog(repository)} + > + ${repository.category === "integration" + ? html` + + ` + : html` + + + `} + ${repository.name} + ${this.hacs.localize("sections.pending_repository_upgrade", { + downloaded: repository.installed_version, + available: repository.available_version, + })} + ` - )} + )} +
` : ""} - - - - ${isComponentLoaded(this.hass, "hassio") - ? html` -
-
-
- -
-
-
-
- ${this.hacs.localize(`sections.addon.title`)} -
-
- ${this.hacs.localize(`sections.addon.description`)} -
+ + ${this.hacs.sections.map( + (page) => html` + +
+
-
+ ${page.name} + ${page.description} + ${!this.narrow ? html`` : ""} + ` - : ""} -
-
-
+ )} + ${isComponentLoaded(this.hass, "hassio") + ? html` + +
+ +
+ ${this.hacs.localize(`sections.addon.title`)} + ${this.hacs.localize(`sections.addon.description`)} +
+ ` + : ""} + +
-
-
-
${this.hacs.localize(`sections.about.title`)}
-
- ${this.hacs.localize(`sections.about.description`)} -
-
-
+ ${this.hacs.localize(`sections.about.title`)} + ${this.hacs.localize(`sections.about.description`)} + + @@ -265,13 +293,19 @@ export class HacsEntryPanel extends LitElement { haStyle, HacsStyles, css` + :host { + --mdc-list-vertical-padding: 0; + } + ha-card:last-child { + margin-bottom: env(safe-area-inset-bottom); + } :host(:not([narrow])) ha-card:last-child { - margin-bottom: 24px; + margin-bottom: max(24px, env(safe-area-inset-bottom)); } ha-config-section { - margin: -16px auto auto; + margin: auto; + margin-top: -32px; max-width: 600px; - color: var(--secondary-text-color); } ha-card { overflow: hidden; @@ -280,69 +314,48 @@ export class HacsEntryPanel extends LitElement { text-decoration: none; color: var(--primary-text-color); } - .title { - font-size: 16px; + a.button { + display: block; + color: var(--primary-color); padding: 16px; - padding-bottom: 0; - } - :host([narrow]) ha-card { - border-radius: 0; - box-shadow: unset; - } - - :host([narrow]) ha-config-section { - margin-top: -42px; - } - .icon-background { - border-radius: 50%; - } - .icon-background ha-svg-icon { - color: #fff; } .title { font-size: 16px; padding: 16px; padding-bottom: 0; } + + @media all and (max-width: 600px) { + ha-card { + border-width: 1px 0; + border-radius: 0; + box-shadow: unset; + } + ha-config-section { + margin-top: -42px; + } + } + ha-svg-icon, ha-icon-next { color: var(--secondary-text-color); height: 24px; width: 24px; + display: block; } ha-svg-icon { padding: 8px; } - - .list-item-icon > * { - height: 40px; - width: 40px; - padding: 0; - } - img { + .icon-background { border-radius: 50%; } - .list-item { - width: 100%; - cursor: pointer; - display: flex; - padding: 16px; - } - .list-item-icon { - margin-right: 16px; + .icon-background ha-svg-icon { + color: #fff; } - .list-item-header { + ha-clickable-list-item { + cursor: pointer; font-size: 16px; - } - .list-item-description { - color: var(--secondary-text-color); - margin-right: 16px; - } - .list-item ha-icon-next, - .list-item ha-svg-icon[right] { - right: 0; - padding: 16px; - position: absolute; + padding: 0; } `, ];