From 146f578d3d943ee469550bbcc05d1b15b3553b8f Mon Sep 17 00:00:00 2001 From: ekzyis Date: Fri, 25 Oct 2024 22:10:15 +0200 Subject: [PATCH] Rename onEdit to toggleEdit --- components/comment.js | 2 +- components/item-info.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/comment.js b/components/comment.js index 6449b2a3..62e455f3 100644 --- a/components/comment.js +++ b/components/comment.js @@ -181,7 +181,7 @@ export default function Comment ({ } edit={edit} - onEdit={e => { setEdit(!edit) }} + toggleEdit={e => { setEdit(!edit) }} editText={edit ? 'cancel' : 'edit'} />} diff --git a/components/item-info.js b/components/item-info.js index 6772334e..921d57f5 100644 --- a/components/item-info.js +++ b/components/item-info.js @@ -30,7 +30,7 @@ import classNames from 'classnames' export default function ItemInfo ({ item, full, commentsText = 'comments', - commentTextSingular = 'comment', className, embellishUser, extraInfo, edit, onEdit, editText, + commentTextSingular = 'comment', className, embellishUser, extraInfo, edit, toggleEdit, editText, onQuoteReply, extraBadges, nested, pinnable, showActionDropdown = true, showUser = true, setDisableRetry, disableRetry }) { @@ -152,7 +152,7 @@ export default function ItemInfo ({ <> @@ -311,7 +311,7 @@ function PaymentInfo ({ item, disableRetry, setDisableRetry }) { ) } -function EditInfo ({ item, edit, canEdit, setCanEdit, onEdit, editText, editThreshold }) { +function EditInfo ({ item, edit, canEdit, setCanEdit, toggleEdit, editText, editThreshold }) { const router = useRouter() if (canEdit) { @@ -320,7 +320,7 @@ function EditInfo ({ item, edit, canEdit, setCanEdit, onEdit, editText, editThre \ onEdit ? onEdit() : router.push(`/items/${item.id}/edit`)} + onClick={() => toggleEdit ? toggleEdit() : router.push(`/items/${item.id}/edit`)} > {editText || 'edit'} {(!item.invoice?.actionState || item.invoice?.actionState === 'PAID') @@ -341,7 +341,7 @@ function EditInfo ({ item, edit, canEdit, setCanEdit, onEdit, editText, editThre \ setEdit(false)} + onClick={() => toggleEdit ? toggleEdit() : router.push(`/items/${item.id}`)} > cancel 00:00