diff --git a/app/soapbox/features/crypto_donate/components/detailed_crypto_address.tsx b/app/soapbox/features/crypto_donate/components/detailed_crypto_address.tsx index 76b83c196..3435273c7 100644 --- a/app/soapbox/features/crypto_donate/components/detailed_crypto_address.tsx +++ b/app/soapbox/features/crypto_donate/components/detailed_crypto_address.tsx @@ -1,8 +1,8 @@ import { QRCodeCanvas as QRCode } from 'qrcode.react'; import React from 'react'; +import CopyableInput from 'soapbox/components/copyable-input'; import Icon from 'soapbox/components/icon'; -import { CopyableInput } from 'soapbox/features/forms'; import { getExplorerUrl } from '../utils/block_explorer'; import { getTitle } from '../utils/coin_db'; @@ -38,9 +38,8 @@ const DetailedCryptoAddress: React.FC = ({ address, tick
-
- -
+ + ); }; diff --git a/app/soapbox/features/forms/index.tsx b/app/soapbox/features/forms/index.tsx index 9504d0560..dc9e3faa0 100644 --- a/app/soapbox/features/forms/index.tsx +++ b/app/soapbox/features/forms/index.tsx @@ -287,29 +287,3 @@ export const FileChooserLogo: React.FC = props => ( FileChooserLogo.defaultProps = { accept: ['image/svg', 'image/png'], }; - -interface ICopyableInput { - value: string, -} - -export const CopyableInput: React.FC = ({ value }) => { - const node = useRef(null); - - const handleCopyClick: React.MouseEventHandler = () => { - if (!node.current) return; - - node.current.select(); - node.current.setSelectionRange(0, 99999); - - document.execCommand('copy'); - }; - - return ( -
- - -
- ); -};