2023-02-16 22:23:59 +00:00
|
|
|
import Link from 'next/link'
|
|
|
|
import { useRouter } from 'next/router'
|
|
|
|
import { useEffect, useState } from 'react'
|
2023-07-24 18:35:05 +00:00
|
|
|
import Badge from 'react-bootstrap/Badge'
|
2023-02-16 22:23:59 +00:00
|
|
|
import Countdown from './countdown'
|
2023-08-08 21:04:06 +00:00
|
|
|
import { abbrNum, numWithUnits } from '../lib/format'
|
2023-08-06 19:18:40 +00:00
|
|
|
import { newComments, commentsViewedAt } from '../lib/new-comments'
|
2023-02-16 22:23:59 +00:00
|
|
|
import { timeSince } from '../lib/time'
|
|
|
|
import { DeleteDropdownItem } from './delete'
|
|
|
|
import styles from './item.module.css'
|
|
|
|
import { useMe } from './me'
|
|
|
|
import DontLikeThisDropdownItem from './dont-link-this'
|
|
|
|
import BookmarkDropdownItem from './bookmark'
|
2023-06-01 00:44:06 +00:00
|
|
|
import SubscribeDropdownItem from './subscribe'
|
2023-02-16 22:23:59 +00:00
|
|
|
import { CopyLinkDropdownItem } from './share'
|
Allow zapping, posting and commenting without funds or an account (#336)
* Add anon zaps
* Add anon comments and posts (link, discussion, poll)
* Use payment hash instead of invoice id as proof of payment
Our invoice IDs can be enumerated.
So there is a - even though very rare - chance that an attacker could find a paid invoice which is not used yet and use it for himself.
Random payment hashes prevent this.
Also, since we delete invoices after use, using database IDs as proof of payments are not suitable.
If a user tells us an invoice ID after we deleted it, we can no longer tell if the invoice was paid or not since the LN node only knows about payment hashes but nothing about the database IDs.
* Allow pay per invoice for stackers
The modal which pops up if the stacker does not have enough sats now has two options: "fund wallet" and "pay invoice"
* Fix onSuccess called twice
For some reason, when calling `showModal`, `useMemo` in modal.js and the code for the modal component (here: <Invoice>) is called twice.
This leads to the `onSuccess` callback being called twice and one failing since the first one deletes the invoice.
* Keep invoice modal open if focus is lost
* Skip anon user during trust calculation
* Add error handling
* Skip 'invoice not found' errors
* Remove duplicate insufficient funds handling
* Fix insufficient funds error detection
* Fix invoice amount for comments
* Allow pay per invoice for bounty and job posts
* Also strike on payment after short press
* Fix unexpected token 'export'
* Fix eslint
* Remove unused id param
* Fix comment copy-paste error
* Rename to useInvoiceable
* Fix unexpected token 'export'
* Fix onConfirmation called at every render
* Add invoice HMAC
This prevents entities which know the invoice hash (like all LN nodes on the payment path) from using the invoice hash on SN.
Only the user which created the invoice knows the HMAC and thus can use the invoice hash.
* make anon posting less hidden, add anon info button explainer
* Fix anon users can't zap other anon users
* Always show repeat and contacts on action error
* Keep track of modal stack
* give anon an icon
* add generic date pivot helper
* make anon user's invoices expire in 5 minutes
* fix forgotten find and replace
* use datePivot more places
* add sat amounts to invoices
* reduce anon invoice expiration to 3 minutes
* don't abbreviate
* Fix [object Object] as error message
Any errors thrown here are already objects of shape { message: string }
* Fix empty invoice creation attempts
I stumbled across this while checking if anons can edit their items.
I monkey patched the code to make it possible (so they can see the 'edit' button) and tried to edit an item but I got this error:
Variable "$amount" of required type "Int!" was not provided.
I fixed this even though this function should never be called without an amount anyway. It will return a sane error in that case now.
* anon func mods, e.g. inv limits
* anon tips should be denormalized
* remove redundant meTotalSats
* correct overlay zap text for anon
* exclude anon from trust graph before algo runs
* remove balance limit on anon
* give anon a bio and remove cowboy hat/top stackers;
* make anon hat appear on profile
* concat hash and hmac and call it a token
* Fix localStorage cleared because error were swallowed
* fix qr layout shift
* restyle fund error modal
* Catch invoice errors in fund error modal
* invoice check backoff
* anon info typo
* make invoice expiration times have saner defaults
* add comma to anon info
* use builtin copy input label
---------
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-11 23:50:57 +00:00
|
|
|
import Hat from './hat'
|
2023-08-16 22:58:43 +00:00
|
|
|
import { AD_USER_ID } from '../lib/constants'
|
2023-08-29 01:27:56 +00:00
|
|
|
import ActionDropdown from './action-dropdown'
|
2023-09-28 20:02:25 +00:00
|
|
|
import MuteDropdownItem from './mute'
|
2023-02-16 22:23:59 +00:00
|
|
|
|
2023-08-08 21:31:43 +00:00
|
|
|
export default function ItemInfo ({
|
|
|
|
item, pendingSats, full, commentsText = 'comments',
|
|
|
|
commentTextSingular = 'comment', className, embellishUser, extraInfo, onEdit, editText
|
|
|
|
}) {
|
2023-02-16 22:23:59 +00:00
|
|
|
const editThreshold = new Date(item.createdAt).getTime() + 10 * 60000
|
|
|
|
const me = useMe()
|
|
|
|
const router = useRouter()
|
|
|
|
const [canEdit, setCanEdit] =
|
|
|
|
useState(item.mine && (Date.now() < editThreshold))
|
|
|
|
const [hasNewComments, setHasNewComments] = useState(false)
|
Allow zapping, posting and commenting without funds or an account (#336)
* Add anon zaps
* Add anon comments and posts (link, discussion, poll)
* Use payment hash instead of invoice id as proof of payment
Our invoice IDs can be enumerated.
So there is a - even though very rare - chance that an attacker could find a paid invoice which is not used yet and use it for himself.
Random payment hashes prevent this.
Also, since we delete invoices after use, using database IDs as proof of payments are not suitable.
If a user tells us an invoice ID after we deleted it, we can no longer tell if the invoice was paid or not since the LN node only knows about payment hashes but nothing about the database IDs.
* Allow pay per invoice for stackers
The modal which pops up if the stacker does not have enough sats now has two options: "fund wallet" and "pay invoice"
* Fix onSuccess called twice
For some reason, when calling `showModal`, `useMemo` in modal.js and the code for the modal component (here: <Invoice>) is called twice.
This leads to the `onSuccess` callback being called twice and one failing since the first one deletes the invoice.
* Keep invoice modal open if focus is lost
* Skip anon user during trust calculation
* Add error handling
* Skip 'invoice not found' errors
* Remove duplicate insufficient funds handling
* Fix insufficient funds error detection
* Fix invoice amount for comments
* Allow pay per invoice for bounty and job posts
* Also strike on payment after short press
* Fix unexpected token 'export'
* Fix eslint
* Remove unused id param
* Fix comment copy-paste error
* Rename to useInvoiceable
* Fix unexpected token 'export'
* Fix onConfirmation called at every render
* Add invoice HMAC
This prevents entities which know the invoice hash (like all LN nodes on the payment path) from using the invoice hash on SN.
Only the user which created the invoice knows the HMAC and thus can use the invoice hash.
* make anon posting less hidden, add anon info button explainer
* Fix anon users can't zap other anon users
* Always show repeat and contacts on action error
* Keep track of modal stack
* give anon an icon
* add generic date pivot helper
* make anon user's invoices expire in 5 minutes
* fix forgotten find and replace
* use datePivot more places
* add sat amounts to invoices
* reduce anon invoice expiration to 3 minutes
* don't abbreviate
* Fix [object Object] as error message
Any errors thrown here are already objects of shape { message: string }
* Fix empty invoice creation attempts
I stumbled across this while checking if anons can edit their items.
I monkey patched the code to make it possible (so they can see the 'edit' button) and tried to edit an item but I got this error:
Variable "$amount" of required type "Int!" was not provided.
I fixed this even though this function should never be called without an amount anyway. It will return a sane error in that case now.
* anon func mods, e.g. inv limits
* anon tips should be denormalized
* remove redundant meTotalSats
* correct overlay zap text for anon
* exclude anon from trust graph before algo runs
* remove balance limit on anon
* give anon a bio and remove cowboy hat/top stackers;
* make anon hat appear on profile
* concat hash and hmac and call it a token
* Fix localStorage cleared because error were swallowed
* fix qr layout shift
* restyle fund error modal
* Catch invoice errors in fund error modal
* invoice check backoff
* anon info typo
* make invoice expiration times have saner defaults
* add comma to anon info
* use builtin copy input label
---------
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-11 23:50:57 +00:00
|
|
|
const [meTotalSats, setMeTotalSats] = useState(0)
|
|
|
|
|
2023-02-16 22:23:59 +00:00
|
|
|
useEffect(() => {
|
2023-05-11 19:34:42 +00:00
|
|
|
if (!full) {
|
|
|
|
setHasNewComments(newComments(item))
|
|
|
|
}
|
2023-02-16 22:23:59 +00:00
|
|
|
}, [item])
|
|
|
|
|
Allow zapping, posting and commenting without funds or an account (#336)
* Add anon zaps
* Add anon comments and posts (link, discussion, poll)
* Use payment hash instead of invoice id as proof of payment
Our invoice IDs can be enumerated.
So there is a - even though very rare - chance that an attacker could find a paid invoice which is not used yet and use it for himself.
Random payment hashes prevent this.
Also, since we delete invoices after use, using database IDs as proof of payments are not suitable.
If a user tells us an invoice ID after we deleted it, we can no longer tell if the invoice was paid or not since the LN node only knows about payment hashes but nothing about the database IDs.
* Allow pay per invoice for stackers
The modal which pops up if the stacker does not have enough sats now has two options: "fund wallet" and "pay invoice"
* Fix onSuccess called twice
For some reason, when calling `showModal`, `useMemo` in modal.js and the code for the modal component (here: <Invoice>) is called twice.
This leads to the `onSuccess` callback being called twice and one failing since the first one deletes the invoice.
* Keep invoice modal open if focus is lost
* Skip anon user during trust calculation
* Add error handling
* Skip 'invoice not found' errors
* Remove duplicate insufficient funds handling
* Fix insufficient funds error detection
* Fix invoice amount for comments
* Allow pay per invoice for bounty and job posts
* Also strike on payment after short press
* Fix unexpected token 'export'
* Fix eslint
* Remove unused id param
* Fix comment copy-paste error
* Rename to useInvoiceable
* Fix unexpected token 'export'
* Fix onConfirmation called at every render
* Add invoice HMAC
This prevents entities which know the invoice hash (like all LN nodes on the payment path) from using the invoice hash on SN.
Only the user which created the invoice knows the HMAC and thus can use the invoice hash.
* make anon posting less hidden, add anon info button explainer
* Fix anon users can't zap other anon users
* Always show repeat and contacts on action error
* Keep track of modal stack
* give anon an icon
* add generic date pivot helper
* make anon user's invoices expire in 5 minutes
* fix forgotten find and replace
* use datePivot more places
* add sat amounts to invoices
* reduce anon invoice expiration to 3 minutes
* don't abbreviate
* Fix [object Object] as error message
Any errors thrown here are already objects of shape { message: string }
* Fix empty invoice creation attempts
I stumbled across this while checking if anons can edit their items.
I monkey patched the code to make it possible (so they can see the 'edit' button) and tried to edit an item but I got this error:
Variable "$amount" of required type "Int!" was not provided.
I fixed this even though this function should never be called without an amount anyway. It will return a sane error in that case now.
* anon func mods, e.g. inv limits
* anon tips should be denormalized
* remove redundant meTotalSats
* correct overlay zap text for anon
* exclude anon from trust graph before algo runs
* remove balance limit on anon
* give anon a bio and remove cowboy hat/top stackers;
* make anon hat appear on profile
* concat hash and hmac and call it a token
* Fix localStorage cleared because error were swallowed
* fix qr layout shift
* restyle fund error modal
* Catch invoice errors in fund error modal
* invoice check backoff
* anon info typo
* make invoice expiration times have saner defaults
* add comma to anon info
* use builtin copy input label
---------
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-11 23:50:57 +00:00
|
|
|
useEffect(() => {
|
|
|
|
if (item) setMeTotalSats(item.meSats + item.meAnonSats + pendingSats)
|
|
|
|
}, [item?.meSats, item?.meAnonSats, pendingSats])
|
|
|
|
|
2023-02-16 22:23:59 +00:00
|
|
|
return (
|
|
|
|
<div className={className || `${styles.other}`}>
|
2023-08-16 22:58:43 +00:00
|
|
|
{!item.position && !(!item.parentId && Number(item.user?.id) === AD_USER_ID) &&
|
2023-02-16 22:23:59 +00:00
|
|
|
<>
|
2023-08-08 21:31:43 +00:00
|
|
|
<span title={`from ${numWithUnits(item.upvotes, {
|
|
|
|
abbreviate: false,
|
|
|
|
unitSingular: 'stacker',
|
|
|
|
unitPlural: 'stackers'
|
|
|
|
})} ${item.mine
|
2023-08-08 21:04:06 +00:00
|
|
|
? `\\ ${numWithUnits(item.meSats, { abbreviate: false })} to post`
|
Allow zapping, posting and commenting without funds or an account (#336)
* Add anon zaps
* Add anon comments and posts (link, discussion, poll)
* Use payment hash instead of invoice id as proof of payment
Our invoice IDs can be enumerated.
So there is a - even though very rare - chance that an attacker could find a paid invoice which is not used yet and use it for himself.
Random payment hashes prevent this.
Also, since we delete invoices after use, using database IDs as proof of payments are not suitable.
If a user tells us an invoice ID after we deleted it, we can no longer tell if the invoice was paid or not since the LN node only knows about payment hashes but nothing about the database IDs.
* Allow pay per invoice for stackers
The modal which pops up if the stacker does not have enough sats now has two options: "fund wallet" and "pay invoice"
* Fix onSuccess called twice
For some reason, when calling `showModal`, `useMemo` in modal.js and the code for the modal component (here: <Invoice>) is called twice.
This leads to the `onSuccess` callback being called twice and one failing since the first one deletes the invoice.
* Keep invoice modal open if focus is lost
* Skip anon user during trust calculation
* Add error handling
* Skip 'invoice not found' errors
* Remove duplicate insufficient funds handling
* Fix insufficient funds error detection
* Fix invoice amount for comments
* Allow pay per invoice for bounty and job posts
* Also strike on payment after short press
* Fix unexpected token 'export'
* Fix eslint
* Remove unused id param
* Fix comment copy-paste error
* Rename to useInvoiceable
* Fix unexpected token 'export'
* Fix onConfirmation called at every render
* Add invoice HMAC
This prevents entities which know the invoice hash (like all LN nodes on the payment path) from using the invoice hash on SN.
Only the user which created the invoice knows the HMAC and thus can use the invoice hash.
* make anon posting less hidden, add anon info button explainer
* Fix anon users can't zap other anon users
* Always show repeat and contacts on action error
* Keep track of modal stack
* give anon an icon
* add generic date pivot helper
* make anon user's invoices expire in 5 minutes
* fix forgotten find and replace
* use datePivot more places
* add sat amounts to invoices
* reduce anon invoice expiration to 3 minutes
* don't abbreviate
* Fix [object Object] as error message
Any errors thrown here are already objects of shape { message: string }
* Fix empty invoice creation attempts
I stumbled across this while checking if anons can edit their items.
I monkey patched the code to make it possible (so they can see the 'edit' button) and tried to edit an item but I got this error:
Variable "$amount" of required type "Int!" was not provided.
I fixed this even though this function should never be called without an amount anyway. It will return a sane error in that case now.
* anon func mods, e.g. inv limits
* anon tips should be denormalized
* remove redundant meTotalSats
* correct overlay zap text for anon
* exclude anon from trust graph before algo runs
* remove balance limit on anon
* give anon a bio and remove cowboy hat/top stackers;
* make anon hat appear on profile
* concat hash and hmac and call it a token
* Fix localStorage cleared because error were swallowed
* fix qr layout shift
* restyle fund error modal
* Catch invoice errors in fund error modal
* invoice check backoff
* anon info typo
* make invoice expiration times have saner defaults
* add comma to anon info
* use builtin copy input label
---------
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-11 23:50:57 +00:00
|
|
|
: `(${numWithUnits(meTotalSats, { abbreviate: false })} from me)`} `}
|
2023-08-08 21:04:06 +00:00
|
|
|
>
|
|
|
|
{numWithUnits(item.sats + pendingSats)}
|
|
|
|
</span>
|
2023-02-16 22:23:59 +00:00
|
|
|
<span> \ </span>
|
|
|
|
</>}
|
|
|
|
{item.boost > 0 &&
|
|
|
|
<>
|
|
|
|
<span>{abbrNum(item.boost)} boost</span>
|
|
|
|
<span> \ </span>
|
|
|
|
</>}
|
2023-08-06 19:18:40 +00:00
|
|
|
<Link
|
|
|
|
href={`/items/${item.id}`} onClick={(e) => {
|
|
|
|
const viewedAt = commentsViewedAt(item)
|
|
|
|
if (viewedAt) {
|
|
|
|
e.preventDefault()
|
|
|
|
router.push(
|
|
|
|
`/items/${item.id}?commentsViewedAt=${viewedAt}`,
|
|
|
|
`/items/${item.id}`)
|
|
|
|
}
|
2023-08-08 21:04:06 +00:00
|
|
|
}} title={numWithUnits(item.commentSats)} className='text-reset position-relative'
|
2023-08-06 19:18:40 +00:00
|
|
|
>
|
2023-08-08 21:31:43 +00:00
|
|
|
{numWithUnits(item.ncomments, {
|
|
|
|
abbreviate: false,
|
|
|
|
unitPlural: commentsText,
|
|
|
|
unitSingular: commentTextSingular
|
|
|
|
})}
|
2023-08-06 18:21:38 +00:00
|
|
|
{hasNewComments &&
|
|
|
|
<span className={styles.notification}>
|
|
|
|
<span className='invisible'>{' '}</span>
|
|
|
|
</span>}
|
2023-02-16 22:23:59 +00:00
|
|
|
</Link>
|
|
|
|
<span> \ </span>
|
|
|
|
<span>
|
2023-07-24 18:35:05 +00:00
|
|
|
<Link href={`/${item.user.name}`}>
|
Allow zapping, posting and commenting without funds or an account (#336)
* Add anon zaps
* Add anon comments and posts (link, discussion, poll)
* Use payment hash instead of invoice id as proof of payment
Our invoice IDs can be enumerated.
So there is a - even though very rare - chance that an attacker could find a paid invoice which is not used yet and use it for himself.
Random payment hashes prevent this.
Also, since we delete invoices after use, using database IDs as proof of payments are not suitable.
If a user tells us an invoice ID after we deleted it, we can no longer tell if the invoice was paid or not since the LN node only knows about payment hashes but nothing about the database IDs.
* Allow pay per invoice for stackers
The modal which pops up if the stacker does not have enough sats now has two options: "fund wallet" and "pay invoice"
* Fix onSuccess called twice
For some reason, when calling `showModal`, `useMemo` in modal.js and the code for the modal component (here: <Invoice>) is called twice.
This leads to the `onSuccess` callback being called twice and one failing since the first one deletes the invoice.
* Keep invoice modal open if focus is lost
* Skip anon user during trust calculation
* Add error handling
* Skip 'invoice not found' errors
* Remove duplicate insufficient funds handling
* Fix insufficient funds error detection
* Fix invoice amount for comments
* Allow pay per invoice for bounty and job posts
* Also strike on payment after short press
* Fix unexpected token 'export'
* Fix eslint
* Remove unused id param
* Fix comment copy-paste error
* Rename to useInvoiceable
* Fix unexpected token 'export'
* Fix onConfirmation called at every render
* Add invoice HMAC
This prevents entities which know the invoice hash (like all LN nodes on the payment path) from using the invoice hash on SN.
Only the user which created the invoice knows the HMAC and thus can use the invoice hash.
* make anon posting less hidden, add anon info button explainer
* Fix anon users can't zap other anon users
* Always show repeat and contacts on action error
* Keep track of modal stack
* give anon an icon
* add generic date pivot helper
* make anon user's invoices expire in 5 minutes
* fix forgotten find and replace
* use datePivot more places
* add sat amounts to invoices
* reduce anon invoice expiration to 3 minutes
* don't abbreviate
* Fix [object Object] as error message
Any errors thrown here are already objects of shape { message: string }
* Fix empty invoice creation attempts
I stumbled across this while checking if anons can edit their items.
I monkey patched the code to make it possible (so they can see the 'edit' button) and tried to edit an item but I got this error:
Variable "$amount" of required type "Int!" was not provided.
I fixed this even though this function should never be called without an amount anyway. It will return a sane error in that case now.
* anon func mods, e.g. inv limits
* anon tips should be denormalized
* remove redundant meTotalSats
* correct overlay zap text for anon
* exclude anon from trust graph before algo runs
* remove balance limit on anon
* give anon a bio and remove cowboy hat/top stackers;
* make anon hat appear on profile
* concat hash and hmac and call it a token
* Fix localStorage cleared because error were swallowed
* fix qr layout shift
* restyle fund error modal
* Catch invoice errors in fund error modal
* invoice check backoff
* anon info typo
* make invoice expiration times have saner defaults
* add comma to anon info
* use builtin copy input label
---------
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-11 23:50:57 +00:00
|
|
|
@{item.user.name}<span> </span><Hat className='fill-grey' user={item.user} height={12} width={12} />
|
2023-07-23 15:08:43 +00:00
|
|
|
{embellishUser}
|
2023-02-16 22:23:59 +00:00
|
|
|
</Link>
|
|
|
|
<span> </span>
|
2023-07-23 15:08:43 +00:00
|
|
|
<Link href={`/items/${item.id}`} title={item.createdAt} className='text-reset' suppressHydrationWarning>
|
|
|
|
{timeSince(new Date(item.createdAt))}
|
2023-02-16 22:23:59 +00:00
|
|
|
</Link>
|
|
|
|
{item.prior &&
|
|
|
|
<>
|
|
|
|
<span> \ </span>
|
2023-07-23 15:08:43 +00:00
|
|
|
<Link href={`/items/${item.prior}`} className='text-reset'>
|
|
|
|
yesterday
|
2023-02-16 22:23:59 +00:00
|
|
|
</Link>
|
|
|
|
</>}
|
|
|
|
</span>
|
2023-05-05 17:38:56 +00:00
|
|
|
{item.subName &&
|
|
|
|
<Link href={`/~${item.subName}`}>
|
2023-07-24 18:35:05 +00:00
|
|
|
{' '}<Badge className={styles.newComment} bg={null}>{item.subName}</Badge>
|
2023-05-02 16:55:10 +00:00
|
|
|
</Link>}
|
2023-02-16 22:23:59 +00:00
|
|
|
{(item.outlawed && !item.mine &&
|
2023-07-23 15:08:43 +00:00
|
|
|
<Link href='/recent/outlawed'>
|
2023-07-24 18:35:05 +00:00
|
|
|
{' '}<Badge className={styles.newComment} bg={null}>outlawed</Badge>
|
2023-05-02 16:55:10 +00:00
|
|
|
</Link>) ||
|
2023-07-23 15:08:43 +00:00
|
|
|
(item.freebie &&
|
|
|
|
<Link href='/recent/freebies'>
|
2023-07-24 18:35:05 +00:00
|
|
|
{' '}<Badge className={styles.newComment} bg={null}>freebie</Badge>
|
2023-02-16 22:23:59 +00:00
|
|
|
</Link>
|
2023-05-02 16:55:10 +00:00
|
|
|
)}
|
2023-02-16 22:23:59 +00:00
|
|
|
{canEdit && !item.deletedAt &&
|
|
|
|
<>
|
|
|
|
<span> \ </span>
|
|
|
|
<span
|
|
|
|
className='text-reset pointer'
|
|
|
|
onClick={() => onEdit ? onEdit() : router.push(`/items/${item.id}/edit`)}
|
|
|
|
>
|
|
|
|
{editText || 'edit'}
|
|
|
|
<Countdown
|
|
|
|
date={editThreshold}
|
|
|
|
onComplete={() => {
|
|
|
|
setCanEdit(false)
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
</>}
|
2023-08-29 01:27:56 +00:00
|
|
|
<ActionDropdown>
|
2023-02-16 22:23:59 +00:00
|
|
|
<CopyLinkDropdownItem item={item} />
|
2023-02-16 23:07:20 +00:00
|
|
|
{me && <BookmarkDropdownItem item={item} />}
|
2023-09-28 20:02:25 +00:00
|
|
|
{me && !item.mine && <SubscribeDropdownItem item={item} />}
|
2023-02-16 23:07:20 +00:00
|
|
|
{item.otsHash &&
|
2023-07-23 15:08:43 +00:00
|
|
|
<Link href={`/items/${item.id}/ots`} className='text-reset dropdown-item'>
|
2023-09-28 20:02:25 +00:00
|
|
|
opentimestamp
|
2023-07-23 15:08:43 +00:00
|
|
|
</Link>}
|
2023-09-14 02:08:03 +00:00
|
|
|
{me && !item.meSats && !item.position &&
|
2023-02-16 22:23:59 +00:00
|
|
|
!item.mine && !item.deletedAt && <DontLikeThisDropdownItem id={item.id} />}
|
|
|
|
{item.mine && !item.position && !item.deletedAt &&
|
2023-08-25 23:21:51 +00:00
|
|
|
<DeleteDropdownItem itemId={item.id} type={item.title ? 'post' : 'comment'} />}
|
2023-09-28 20:02:25 +00:00
|
|
|
{me && !item.mine &&
|
|
|
|
<>
|
|
|
|
<hr className='dropdown-divider' />
|
|
|
|
<MuteDropdownItem user={item.user} />
|
|
|
|
</>}
|
2023-08-29 01:27:56 +00:00
|
|
|
</ActionDropdown>
|
2023-02-16 23:14:14 +00:00
|
|
|
{extraInfo}
|
2023-02-16 22:23:59 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|