From 0781b84f11da9d228348b3ffd7b43e2b182531f3 Mon Sep 17 00:00:00 2001 From: batmanisko Date: Mon, 3 Nov 2025 12:57:17 +0100 Subject: [PATCH] =?UTF-8?q?Kop=C3=ADrov=C3=A1n=C3=AD=20komenta=C5=99e=20na?= =?UTF-8?q?=20kliknut=C3=AD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 3b39026..c764ab6 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -278,6 +278,12 @@ function App() { } } + const copyNote = async (note: string) => { + if (auth?.login && note) { + await updateNote({ body: { note, dayIndex } }); + } + } + const pizzaSuggestions = useMemo(() => { if (!data?.pizzaList) { return []; @@ -535,7 +541,19 @@ function App() { } {login} {userPayload.departureTime && ({userPayload.departureTime})} - {userPayload.note && ({userPayload.note})} + {userPayload.note && copyNote(userPayload.note!)} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + copyNote(userPayload.note!); + } + }} + tabIndex={0} + role="button" + > ({userPayload.note})} {login === auth.login && canChangeChoice && { setNoteModalOpen(true);