Kopírování komentaře na kliknutí.
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful

This commit is contained in:
batmanisko 2025-11-03 12:57:17 +01:00
parent e3d217822a
commit 0781b84f11

View File

@ -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() {
</span>}
{login}
{userPayload.departureTime && <small> ({userPayload.departureTime})</small>}
{userPayload.note && <small style={{ overflowWrap: 'anywhere' }}> ({userPayload.note})</small>}
{userPayload.note && <small
style={{ overflowWrap: 'anywhere', cursor: 'pointer', color: '#0d6efd' }}
title="Kliknutím zkopírujete poznámku"
onClick={() => copyNote(userPayload.note!)}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
copyNote(userPayload.note!);
}
}}
tabIndex={0}
role="button"
> ({userPayload.note})</small>}
{login === auth.login && canChangeChoice && <span title='Upravit poznámku'>
<FontAwesomeIcon onClick={() => {
setNoteModalOpen(true);