mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Hide demo card when showing demo from frontpage (#21243)
* Hide demo card when showing demo from frontpage * Store in constant on load * reverse * Remove filter * move constnat * Make Home Assistant title
This commit is contained in:
parent
d01377da3c
commit
76abfea6ed
@ -1,3 +1,4 @@
|
|||||||
|
import { isFrontpageEmbed } from "../../util/is_frontpage";
|
||||||
import { DemoConfig } from "../types";
|
import { DemoConfig } from "../types";
|
||||||
|
|
||||||
export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||||
@ -5,14 +6,18 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
|||||||
views: [
|
views: [
|
||||||
{
|
{
|
||||||
type: "sections",
|
type: "sections",
|
||||||
title: "Demo",
|
title: isFrontpageEmbed ? "Home Assistant" : "Demo",
|
||||||
path: "home",
|
path: "home",
|
||||||
icon: "mdi:home-assistant",
|
icon: "mdi:home-assistant",
|
||||||
sections: [
|
sections: [
|
||||||
{
|
...(isFrontpageEmbed
|
||||||
title: "Welcome 👋",
|
? []
|
||||||
cards: [{ type: "custom:ha-demo-card" }],
|
: [
|
||||||
},
|
{
|
||||||
|
title: "Welcome 👋",
|
||||||
|
cards: [{ type: "custom:ha-demo-card" }],
|
||||||
|
},
|
||||||
|
]),
|
||||||
{
|
{
|
||||||
cards: [
|
cards: [
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import "../../src/resources/safari-14-attachshadow-patch";
|
import "../../src/resources/safari-14-attachshadow-patch";
|
||||||
|
import "./util/is_frontpage";
|
||||||
import "./ha-demo";
|
import "./ha-demo";
|
||||||
|
|
||||||
import("../../src/resources/ha-style");
|
import("../../src/resources/ha-style");
|
||||||
|
1
demo/src/util/is_frontpage.ts
Normal file
1
demo/src/util/is_frontpage.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const isFrontpageEmbed = document.location.search === "?frontpage";
|
Loading…
x
Reference in New Issue
Block a user