mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-21 21:29:20 +01:00
Add menu item to copy handle
This commit is contained in:
parent
b48d32e503
commit
0b81b5bfd2
2 changed files with 22 additions and 0 deletions
|
@ -102,4 +102,5 @@ export const ICONS = {
|
||||||
document: () => import('@iconify-icons/mingcute/document-line'),
|
document: () => import('@iconify-icons/mingcute/document-line'),
|
||||||
'arrows-right': () => import('@iconify-icons/mingcute/arrows-right-line'),
|
'arrows-right': () => import('@iconify-icons/mingcute/arrows-right-line'),
|
||||||
code: () => import('@iconify-icons/mingcute/code-line'),
|
code: () => import('@iconify-icons/mingcute/code-line'),
|
||||||
|
copy: () => import('@iconify-icons/mingcute/copy-2-line'),
|
||||||
};
|
};
|
||||||
|
|
|
@ -1053,6 +1053,27 @@ function RelatedActions({
|
||||||
<MenuDivider />
|
<MenuDivider />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
const handle = `@${currentInfo?.acct || acct}`;
|
||||||
|
try {
|
||||||
|
navigator.clipboard.writeText(handle);
|
||||||
|
showToast('Handle copied');
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
showToast('Unable to copy handle');
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon icon="copy" />
|
||||||
|
<small>
|
||||||
|
Copy handle
|
||||||
|
<br />
|
||||||
|
<span class="more-insignificant">
|
||||||
|
@{currentInfo?.acct || acct}
|
||||||
|
</span>
|
||||||
|
</small>
|
||||||
|
</MenuItem>
|
||||||
<MenuItem href={url} target="_blank">
|
<MenuItem href={url} target="_blank">
|
||||||
<Icon icon="external" />
|
<Icon icon="external" />
|
||||||
<small class="menu-double-lines">{niceAccountURL(url)}</small>
|
<small class="menu-double-lines">{niceAccountURL(url)}</small>
|
||||||
|
|
Loading…
Reference in a new issue