Copy ln addr when you click on the ln addr button on user profile
This commit is contained in:
parent
6b8820b7ab
commit
c073847eb7
|
@ -22,6 +22,8 @@ import SubscribeUserDropdownItem from './subscribeUser'
|
||||||
import ActionDropdown from './action-dropdown'
|
import ActionDropdown from './action-dropdown'
|
||||||
import CodeIcon from '../svgs/terminal-box-fill.svg'
|
import CodeIcon from '../svgs/terminal-box-fill.svg'
|
||||||
import MuteDropdownItem from './mute'
|
import MuteDropdownItem from './mute'
|
||||||
|
import copy from 'clipboard-copy'
|
||||||
|
import { useToast } from './toast'
|
||||||
|
|
||||||
export default function UserHeader ({ user }) {
|
export default function UserHeader ({ user }) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
@ -180,6 +182,7 @@ function HeaderNym ({ user, isMe }) {
|
||||||
function HeaderHeader ({ user }) {
|
function HeaderHeader ({ user }) {
|
||||||
const me = useMe()
|
const me = useMe()
|
||||||
const showModal = useShowModal()
|
const showModal = useShowModal()
|
||||||
|
const toaster = useToast()
|
||||||
|
|
||||||
const isMe = me?.name === user.name
|
const isMe = me?.name === user.name
|
||||||
const Satistics = () => (
|
const Satistics = () => (
|
||||||
|
@ -196,6 +199,12 @@ function HeaderHeader ({ user }) {
|
||||||
<Satistics user={user} />
|
<Satistics user={user} />
|
||||||
<Button
|
<Button
|
||||||
className='fw-bold ms-0' onClick={() => {
|
className='fw-bold ms-0' onClick={() => {
|
||||||
|
copy(`${user.name}@stacker.news`)
|
||||||
|
.then(() => {
|
||||||
|
toaster.success(`copied ${user.name}@stacker.news to clipboard`)
|
||||||
|
}).catch(() => {
|
||||||
|
toaster.error(`failed to copy ${user.name}@stacker.news to clipboard`)
|
||||||
|
})
|
||||||
showModal(({ onClose }) => (
|
showModal(({ onClose }) => (
|
||||||
<>
|
<>
|
||||||
<a className='d-flex m-auto p-3' style={{ background: 'white', width: 'fit-content' }} href={`lightning:${lnurlp}`}>
|
<a className='d-flex m-auto p-3' style={{ background: 'white', width: 'fit-content' }} href={`lightning:${lnurlp}`}>
|
||||||
|
|
Loading…
Reference in New Issue