From ebdbab81d3bbd032b5b9f72d1954d273131e6888 Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Wed, 28 Feb 2024 13:51:59 +0100 Subject: [PATCH] Mobile view calendar improvements (#19218) * Mobile view calendar improvements * Remove very narrow * Revert default choice --- src/panels/calendar/ha-full-calendar.ts | 12 +++++++++++- src/panels/lovelace/cards/hui-calendar-card.ts | 11 +++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/panels/calendar/ha-full-calendar.ts b/src/panels/calendar/ha-full-calendar.ts index e1b3b082964e..46ceac93c9ad 100644 --- a/src/panels/calendar/ha-full-calendar.ts +++ b/src/panels/calendar/ha-full-calendar.ts @@ -188,7 +188,7 @@ export class HAFullCalendar extends LitElement { -
+
* { + margin-bottom: 5px; + box-sizing: border-box; + } + .today { margin-right: 20px; margin-inline-end: 20px; diff --git a/src/panels/lovelace/cards/hui-calendar-card.ts b/src/panels/lovelace/cards/hui-calendar-card.ts index 047118828ad1..1a31a6d1cf64 100644 --- a/src/panels/lovelace/cards/hui-calendar-card.ts +++ b/src/panels/lovelace/cards/hui-calendar-card.ts @@ -69,8 +69,6 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard { @state() private _narrow = false; - @state() private _veryNarrow = false; - @state() private _error?: string = undefined; private _startDate?: Date; @@ -121,9 +119,11 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard { return nothing; } - const views: FullCalendarView[] = this._veryNarrow - ? ["listWeek"] - : ["dayGridMonth", "dayGridDay", "listWeek"]; + const views: FullCalendarView[] = [ + "dayGridMonth", + "dayGridDay", + "listWeek", + ]; return html` @@ -206,7 +206,6 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard { return; } this._narrow = card.offsetWidth < 870; - this._veryNarrow = card.offsetWidth < 350; } private async _attachObserver(): Promise {