diff --git a/src/components/Copyable.tsx b/src/components/Copyable.tsx deleted file mode 100644 index ce92767c99..0000000000 --- a/src/components/Copyable.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { Copy } from '@phosphor-icons/react'; -import { useState } from 'react'; -import Tooltip from './Tooltip'; -import { copyTextToClipboard } from 'utils/copyToClipboard.utils'; - -interface CopyableProps { - className?: string; - text: string; -} -export default function Copyable({ className = '', text }: Readonly): JSX.Element { - const [justCopied, setJustCopied] = useState(false); - - async function onCopy() { - await copyTextToClipboard(text); - setJustCopied(true); - setTimeout(() => setJustCopied(false), 1000); - } - return ( -
-

{text}

- - - -
- ); -} diff --git a/src/components/index.ts b/src/components/index.ts index 89f0cff19e..a8d352acd2 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -7,7 +7,6 @@ export { default as BreadcrumbsMenuDrive } from './BreadcrumbsMenuDrive'; export { default as BreadcrumbsMoveItemsDialogView } from './BreadcrumbsMoveItemsDialogView'; export * from './BreadcrumbsHelper'; export { default as Card } from './Card'; -export { default as Copyable } from './Copyable'; export { default as Empty } from './Empty'; export { default as ExpiredLinkView } from './ExpiredLinkView'; export { LoadingRowSkeleton } from './LoadingRowSkeleton'; diff --git a/src/views/NewSettings/components/Sections/Account/Security/components/TwoFactorAuthenticationEnableModal.tsx b/src/views/NewSettings/components/Sections/Account/Security/components/TwoFactorAuthenticationEnableModal.tsx index 563696d17a..06f944e0e9 100644 --- a/src/views/NewSettings/components/Sections/Account/Security/components/TwoFactorAuthenticationEnableModal.tsx +++ b/src/views/NewSettings/components/Sections/Account/Security/components/TwoFactorAuthenticationEnableModal.tsx @@ -1,11 +1,10 @@ import { Warning } from '@phosphor-icons/react'; import { useEffect, useState } from 'react'; import authService, { generateNew2FA } from 'services/auth.service'; -import { Button, Input, Loader, Modal } from '@internxt/ui'; +import { Button, Copyable, Input, Loader, Modal } from '@internxt/ui'; import appStoreIcon from 'app/../assets/icons/app-store.svg'; import playStoreIcon from 'app/../assets/icons/play-store.svg'; import useEffectAsync from 'hooks/useEffectAsync'; -import Copyable from 'components/Copyable'; import notificationsService, { ToastType } from 'app/notifications/services/notifications.service'; import { useTranslationContext } from 'app/i18n/provider/TranslationProvider'; import errorService from 'services/error.service';