From e40a0c844c837e8cc6aedcdd58bfbec8657a775b Mon Sep 17 00:00:00 2001 From: pierrbt Date: Fri, 23 Jun 2023 16:14:52 +0200 Subject: [PATCH] Creating CopyTextField component and adding it to showCompletedUpload and Shaere Modal --- .../modals/showCompletedReverseShareModal.tsx | 25 ++--------- .../src/components/upload/CopyTextField.tsx | 45 +++++++++++++++++++ .../modals/showCompletedUploadModal.tsx | 38 ++-------------- 3 files changed, 52 insertions(+), 56 deletions(-) create mode 100644 frontend/src/components/upload/CopyTextField.tsx diff --git a/frontend/src/components/share/modals/showCompletedReverseShareModal.tsx b/frontend/src/components/share/modals/showCompletedReverseShareModal.tsx index 54a872a..cb1047d 100644 --- a/frontend/src/components/share/modals/showCompletedReverseShareModal.tsx +++ b/frontend/src/components/share/modals/showCompletedReverseShareModal.tsx @@ -1,9 +1,7 @@ -import { ActionIcon, Button, Stack, TextInput } from "@mantine/core"; -import { useClipboard } from "@mantine/hooks"; +import { Button, Stack } from "@mantine/core"; import { useModals } from "@mantine/modals"; import { ModalsContextProps } from "@mantine/modals/lib/context"; -import { TbCopy } from "react-icons/tb"; -import toast from "../../../utils/toast.util"; +import CopyTextField from "../../upload/CopyTextField"; const showCompletedReverseShareModal = ( modals: ModalsContextProps, @@ -26,28 +24,11 @@ const Body = ({ link: string; getReverseShares: () => void; }) => { - const clipboard = useClipboard({ timeout: 500 }); const modals = useModals(); return ( - { - clipboard.copy(link); - toast.success("Your link was copied to the keyboard."); - }} - > - - - ) - } - /> +