From 1a1649bbb94f365818b53c3174b20b151078fa19 Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Fri, 26 Jul 2024 16:56:29 +0200 Subject: [PATCH] make side pane toggle placeholder dynamically --- dist/index.js | 23 ++++++++++++++----- src/View/ChatPages/calendarPage.css | 1 + src/View/ChatPages/calendarPage.tsx | 35 +++++++++++++++++++---------- 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/dist/index.js b/dist/index.js index d8f520b7..f9899ab6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2790,7 +2790,7 @@ } } ); - const sidePaneContent = createProxyState( + const sidePaneContentWrapper = createProxyState( [ calendarPageViewModel.selectedYear, calendarPageViewModel.selectedMonth, @@ -2800,14 +2800,25 @@ const listState = calendarPageViewModel.getEventsForDate(); if (listState == void 0) { return /* @__PURE__ */ createElement("div", null); - } else if (listState.value.size == 0) { - return /* @__PURE__ */ createElement("div", { class: "width-100 height-100 flex-column justify-center align-center" }, /* @__PURE__ */ createElement("span", { class: "secondary" }, translations.chatPage.calendar.noEvents)); } else { + const sidePaneContent = createProxyState([listState], () => { + if (listState.value.size == 0) { + return /* @__PURE__ */ createElement("div", { class: "width-100 height-100 flex-column justify-center align-center" }, /* @__PURE__ */ createElement("span", { class: "secondary slide-up" }, translations.chatPage.calendar.noEvents)); + } else { + return /* @__PURE__ */ createElement( + "div", + { + class: "flex-column gap slide-up padding-bottom", + "children:append": [listState, TaskViewModelToEntry] + } + ); + } + }); return /* @__PURE__ */ createElement( "div", { - class: "flex-column gap slide-up", - "children:append": [listState, TaskViewModelToEntry] + class: "width-100 height-100", + "children:set": sidePaneContent } ); } @@ -2881,7 +2892,7 @@ class: "pane-wrapper side background", "set:color": calendarPageViewModel.chatViewModel.displayedColor }, - /* @__PURE__ */ createElement("div", { class: "pane" }, /* @__PURE__ */ createElement("div", { class: "content", "children:set": sidePaneContent })) + /* @__PURE__ */ createElement("div", { class: "pane" }, /* @__PURE__ */ createElement("div", { class: "content", "children:set": sidePaneContentWrapper })) ), /* @__PURE__ */ createElement("div", { "children:set": taskSettingsModal })); } diff --git a/src/View/ChatPages/calendarPage.css b/src/View/ChatPages/calendarPage.css index b36dbd62..2a6a0cf8 100644 --- a/src/View/ChatPages/calendarPage.css +++ b/src/View/ChatPages/calendarPage.css @@ -60,6 +60,7 @@ width: 3.1rem; } + @media (max-width: 1024px) { #chat-page > div > #main > #calendar-page { flex-direction: column; diff --git a/src/View/ChatPages/calendarPage.tsx b/src/View/ChatPages/calendarPage.tsx index ed76b6cd..3e9bf1c7 100644 --- a/src/View/ChatPages/calendarPage.tsx +++ b/src/View/ChatPages/calendarPage.tsx @@ -33,7 +33,7 @@ export function CalendarPage(calendarPageViewModel: CalendarPageViewModel) { } ); - const sidePaneContent = React.createProxyState( + const sidePaneContentWrapper = React.createProxyState( [ calendarPageViewModel.selectedYear, calendarPageViewModel.selectedMonth, @@ -44,19 +44,30 @@ export function CalendarPage(calendarPageViewModel: CalendarPageViewModel) { if (listState == undefined) { return
; - } else if (listState.value.size == 0) { - return ( -
- - {translations.chatPage.calendar.noEvents} - -
- ); } else { + const sidePaneContent = React.createProxyState([listState], () => { + if (listState.value.size == 0) { + return ( +
+ + {translations.chatPage.calendar.noEvents} + +
+ ); + } else { + return ( +
+ ); + } + }); + return (
); } @@ -156,7 +167,7 @@ export function CalendarPage(calendarPageViewModel: CalendarPageViewModel) { set:color={calendarPageViewModel.chatViewModel.displayedColor} >
-
+