diff --git a/components/comment.js b/components/comment.js index 176ab6f1..6449b2a3 100644 --- a/components/comment.js +++ b/components/comment.js @@ -180,6 +180,7 @@ export default function Comment ({ } } + edit={edit} onEdit={e => { setEdit(!edit) }} editText={edit ? 'cancel' : 'edit'} />} diff --git a/components/item-info.js b/components/item-info.js index ba0c3732..6772334e 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, onEdit, editText, + commentTextSingular = 'comment', className, embellishUser, extraInfo, edit, onEdit, editText, onQuoteReply, extraBadges, nested, pinnable, showActionDropdown = true, showUser = true, setDisableRetry, disableRetry }) { @@ -151,7 +151,7 @@ export default function ItemInfo ({ showActionDropdown && <> @@ -311,7 +311,7 @@ function PaymentInfo ({ item, disableRetry, setDisableRetry }) { ) } -function EditInfo ({ item, canEdit, setCanEdit, onEdit, editText, editThreshold }) { +function EditInfo ({ item, edit, canEdit, setCanEdit, onEdit, editText, editThreshold }) { const router = useRouter() if (canEdit) { @@ -334,5 +334,21 @@ function EditInfo ({ item, canEdit, setCanEdit, onEdit, editText, editThreshold ) } + if (edit && !canEdit) { + // if we're still editing after timer ran out + return ( + <> + \ + setEdit(false)} + > + cancel + 00:00 + + + ) + } + return null }