Browse Source

feat: make reply clickable

imwald
codytseng 11 months ago
parent
commit
a10c9d8ffe
  1. 6
      src/components/ReplyNote/index.tsx

6
src/components/ReplyNote/index.tsx

@ -10,6 +10,8 @@ import NoteStats from '../NoteStats'
import ParentNotePreview from '../ParentNotePreview' import ParentNotePreview from '../ParentNotePreview'
import UserAvatar from '../UserAvatar' import UserAvatar from '../UserAvatar'
import Username from '../Username' import Username from '../Username'
import { useSecondaryPage } from '@/PageManager'
import { toNote } from '@/lib/link'
export default function ReplyNote({ export default function ReplyNote({
event, event,
@ -23,6 +25,7 @@ export default function ReplyNote({
highlight?: boolean highlight?: boolean
}) { }) {
const { t } = useTranslation() const { t } = useTranslation()
const { push } = useSecondaryPage()
const { mutePubkeys } = useMuteList() const { mutePubkeys } = useMuteList()
const [showMuted, setShowMuted] = useState(false) const [showMuted, setShowMuted] = useState(false)
const show = useMemo( const show = useMemo(
@ -32,7 +35,8 @@ export default function ReplyNote({
return ( return (
<div <div
className={`flex space-x-2 items-start px-4 py-3 border-b transition-colors duration-500 ${highlight ? 'bg-primary/50' : ''}`} className={`flex space-x-2 items-start px-4 py-3 border-b transition-colors duration-500 clickable ${highlight ? 'bg-primary/50' : ''}`}
onClick={() => push(toNote(event))}
> >
<UserAvatar userId={event.pubkey} size="small" className="shrink-0" /> <UserAvatar userId={event.pubkey} size="small" className="shrink-0" />
<div className="w-full overflow-hidden"> <div className="w-full overflow-hidden">

Loading…
Cancel
Save