diff --git a/www/package.json b/www/package.json index a8ac16aa1..2c1ca61ef 100644 --- a/www/package.json +++ b/www/package.json @@ -80,7 +80,7 @@ "@icongo/wi": "1.2.0", "@icongo/wl": "1.2.0", "@types/react-lazy-load-image-component": "^1.5.2", - "@uiw/copy-to-clipboard": "^1.0.12", + "@uiw/copy-to-clipboard": "^1.0.17", "@uiw/react-back-to-top": "^1.2.0", "@uiw/react-github-corners": "^1.5.14", "@uiw/react-markdown-preview": "^4.0.23", diff --git a/www/src/components/IconCard.tsx b/www/src/components/IconCard.tsx index a0ad104ff..fd880db85 100644 --- a/www/src/components/IconCard.tsx +++ b/www/src/components/IconCard.tsx @@ -3,7 +3,7 @@ import { useNavigate, NavLink } from 'react-router-dom'; import styled from 'styled-components'; import Keywords from 'react-keywords'; import toast from 'react-hot-toast'; -import clipboard from 'clipboardy'; +import copyTextToClipboard from '@uiw/copy-to-clipboard'; import { BIBxsCopy, BIBxsCloudDownload, BIBxsHomeCircle } from '@icongo/bi'; // @ts-ignore import { LazyLoadImage } from 'react-lazy-load-image-component'; @@ -120,7 +120,7 @@ export const Card: React.FC> = (props) => { const componentName = name.replace(',', ''); const copyName = () => { - clipboard.write(componentName); + copyTextToClipboard(componentName); toast.success(
Copied '{componentName}' name to clipboard
, { position: 'top-right' }); $ref.current?.focus() } @@ -128,7 +128,7 @@ export const Card: React.FC> = (props) => { evn.stopPropagation(); fetch(path!).then(response => response.text()).then((svgStr) => { toast.success(, { position: 'bottom-right' }); - clipboard.write(svgStr); + copyTextToClipboard(svgStr); toast.success(
Copied '{componentName}' icon HTML code to clipboard
, { position: 'top-right' }); $ref.current?.focus(); }).catch(() => { diff --git a/www/src/pages/IconDetail.tsx b/www/src/pages/IconDetail.tsx index dd03849ad..b010744e3 100644 --- a/www/src/pages/IconDetail.tsx +++ b/www/src/pages/IconDetail.tsx @@ -3,7 +3,7 @@ import { useParams, Link } from 'react-router-dom'; import styled from 'styled-components'; import toast from 'react-hot-toast'; import MarkdownPreview from '@uiw/react-markdown-preview'; -import clipboard from 'clipboardy'; +import copyTextToClipboard from '@uiw/copy-to-clipboard'; import { FADownload } from '@icongo/fa/lib/FADownload'; import { FACopy } from '@icongo/fa/lib/FACopy'; import { FAHouseChimneyCrack } from '@icongo/fa/lib/FAHouseChimneyCrack'; @@ -129,7 +129,7 @@ export const IconDetailPage = () => { const copySVGHTML = (evn: React.MouseEvent) => { evn.stopPropagation(); evn.preventDefault(); - clipboard.write(`${svgString}`); + copyTextToClipboard(`${svgString}`); toast.success(
Copied '{filename}' icon HTML code to clipboard
, { position: 'top-right' }); return false } @@ -150,7 +150,7 @@ export const IconDetailPage = () => { const copyComName = (evn: React.MouseEvent) => { evn.stopPropagation(); evn.preventDefault(); - clipboard.write(`${comName || ""}`); + copyTextToClipboard(`${comName || ""}`); toast.success(
Copied '{comName}' name to clipboard
, { position: 'top-right' }); return false }