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);