Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile view calendar improvements #19218

Merged
merged 6 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/panels/calendar/ha-full-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class HAFullCalendar extends LitElement {
</ha-icon-button-next>
</div>
</div>
<div class="controls">
<div class="controls buttons">
<mwc-button
outlined
class="today"
Expand Down Expand Up @@ -480,6 +480,16 @@ export class HAFullCalendar extends LitElement {
width: 100%;
}

.buttons {
display: flex;
flex-wrap: wrap;
}

.buttons > * {
margin-bottom: 5px;
box-sizing: border-box;
}

.today {
margin-right: 20px;
margin-inline-end: 20px;
Expand Down
11 changes: 5 additions & 6 deletions src/panels/lovelace/cards/hui-calendar-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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`
<ha-card>
Expand Down Expand Up @@ -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<void> {
Expand Down
Loading