diff --git a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.tsx b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.tsx new file mode 100644 index 00000000..78f2c6b6 --- /dev/null +++ b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.tsx @@ -0,0 +1,42 @@ +import { useState } from 'react'; + +import Languages from 'features/global/services/languages-service'; +import { copyToClipboard } from '@features/global/utils/CopyClipboard'; + +import { Button } from '@atoms/button/button'; +import { LinkIcon, CheckCircleIcon } from '@heroicons/react/outline'; + +export const CopyLinkButton = (props: { + textToCopy?: string | false; +}) => { + const [didJustCompleteACopy, setDidJustCompleteACopy] = useState(false); + const haveTextToCopy = props.textToCopy && props.textToCopy.length > 0 || false; + return ( + + ); +} \ No newline at end of file diff --git a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/public-link-access.tsx b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/public-link-access.tsx index cd88a3b3..635b2f35 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/public-link-access.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/public-link-access.tsx @@ -9,6 +9,7 @@ import { Button } from '@atoms/button/button'; import { LinkIcon, UserGroupIcon, CheckCircleIcon } from '@heroicons/react/outline'; import type { DriveFileAccessLevelForPublicLink } from 'app/features/drive/types'; import { changePublicLink } from '@features/files/utils/access-info-helpers'; +import { CopyLinkButton } from './copy-link-button'; export const PublicLinkManager = ({ id, disabled }: { id: string; disabled?: boolean }) => { const { item, loading, update } = useDriveItem(id); @@ -42,34 +43,9 @@ export const PublicLinkManager = ({ id, disabled }: { id: string; disabled?: boo theme={havePublicLink ? "blue" : "outline"} value={havePublicLink ? publicLink : Languages.t('components.public-link-acess.public-link-placeholder')} /> - +