From 1bf56b692c39e621b188ecd168729ec0acbebbd7 Mon Sep 17 00:00:00 2001 From: ncomerci Date: Wed, 28 Jun 2023 15:01:09 -0300 Subject: [PATCH] copy renamed to handleCopy --- src/components/Error/ErrorMessage.tsx | 15 ++++++++------- src/components/Modal/SuccessModal.tsx | 10 +++++----- src/hooks/useClipboardCopy.ts | 4 ++-- src/hooks/useForumConnect.ts | 6 +++--- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/components/Error/ErrorMessage.tsx b/src/components/Error/ErrorMessage.tsx index 8f0f87d07..4c6825b38 100644 --- a/src/components/Error/ErrorMessage.tsx +++ b/src/components/Error/ErrorMessage.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from 'react' +import React, { useState } from 'react' import classNames from 'classnames' import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown' @@ -19,17 +19,13 @@ interface Props { export default function ErrorMessage({ label, errorMessage }: Props) { const t = useFormatMessage() - const { copiedValue, copy } = useClipboardCopy(Time.Second) + const { copiedValue, handleCopy } = useClipboardCopy(Time.Second) const [open, setOpen] = useState(false) const toggleHandler = () => { setOpen(!open) } - const handleCopy = useCallback(() => { - copy(errorMessage) - }, [errorMessage, copy]) - return (
@@ -42,7 +38,12 @@ export default function ErrorMessage({ label, errorMessage }: Props) {
{errorMessage}
-
diff --git a/src/components/Modal/SuccessModal.tsx b/src/components/Modal/SuccessModal.tsx index 0a3377597..cd9ce1068 100644 --- a/src/components/Modal/SuccessModal.tsx +++ b/src/components/Modal/SuccessModal.tsx @@ -32,12 +32,12 @@ export function SuccessModal({ ...props }: SuccessModalProps) { const t = useFormatMessage() - const { copiedValue, copy } = useClipboardCopy(Time.Second) - const handleCopy = useCallback(() => { + const { copiedValue, handleCopy } = useClipboardCopy(Time.Second) + const handleCopyClick = useCallback(() => { if (linkToCopy) { - copy(linkToCopy) + handleCopy(linkToCopy) } - }, [linkToCopy, copy]) + }, [linkToCopy, handleCopy]) return (