From a231adc66403e55afcf0194d86adcfbc3bc03963 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 25 Jan 2022 03:24:46 +0100 Subject: [PATCH] [Perf] Calendar Modal: Small optimizations --- src/components/common/CalendarModal.tsx | 6 ++++- .../middle/message/ContextMenuContainer.tsx | 23 +++++++++++-------- .../right/management/ManageInvite.tsx | 4 ++-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/components/common/CalendarModal.tsx b/src/components/common/CalendarModal.tsx index 82cf4e19b..bcaa79af0 100644 --- a/src/components/common/CalendarModal.tsx +++ b/src/components/common/CalendarModal.tsx @@ -130,6 +130,10 @@ const CalendarModal: FC = ({ buildCalendarGrid(currentYear, currentMonth) ), [currentMonth, currentYear]); + const submitLabel = useMemo(() => { + return submitButtonLabel || formatSubmitLabel(lang, selectedDate); + }, [lang, selectedDate, submitButtonLabel]); + function handlePrevMonth() { setCurrentMonthAndYear((d) => { const dateCopy = new Date(d); @@ -312,7 +316,7 @@ const CalendarModal: FC = ({
{secondButtonLabel && (