mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex-taker-v2.git
synced 2026-09-21 16:52:01 -07:00
feat(nostr): Added markdown support to Nostr Chat
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import React, { useEffect, useRef, useState } from 'react'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { faUser } from '@fortawesome/free-solid-svg-icons'
|
||||
import NostrFormat from '../../app-body/nostr/nostr-format'
|
||||
|
||||
function MessageItem (props) {
|
||||
const { message, profiles } = props
|
||||
@@ -26,7 +27,7 @@ function MessageItem (props) {
|
||||
if (!profile && profiles[message.pubkey]) {
|
||||
setProfile(profiles[message.pubkey])
|
||||
}
|
||||
}, [profiles, message])
|
||||
}, [profiles, message, profile])
|
||||
|
||||
useEffect(() => {
|
||||
if (msgRef.current && message.latest) {
|
||||
@@ -35,7 +36,7 @@ function MessageItem (props) {
|
||||
block: 'end'
|
||||
})
|
||||
}
|
||||
}, [msgRef.current, message])
|
||||
}, [message])
|
||||
|
||||
return (
|
||||
<div className='mb-3 d-flex align-items-start' ref={msgRef}>
|
||||
@@ -86,7 +87,8 @@ function MessageItem (props) {
|
||||
<small className='text-muted'>{formatTime(message.created_at * 1000)}</small>
|
||||
</div>
|
||||
<div style={{ lineHeight: '1.4', wordBreak: 'break-all' }}>
|
||||
{message.content}
|
||||
<NostrFormat content={message.content} />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ const config = {
|
||||
'wss://nos.lol',
|
||||
'wss://relay.damus.io'
|
||||
],
|
||||
chatsId: [
|
||||
chatsId: [
|
||||
'32b0ebc01c984008977fbe476e064946990df75525331b24b37bbba5e89f4039'
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user