From 561e5e14144acc613834f960978f0d14b9d614a7 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 22 Jul 2024 19:35:21 -0300 Subject: [PATCH] fix: adjust prop component copy text --- src/components/CopyText/index.spec.tsx | 2 +- src/components/CopyText/index.tsx | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/CopyText/index.spec.tsx b/src/components/CopyText/index.spec.tsx index 1a45337..1e0df97 100644 --- a/src/components/CopyText/index.spec.tsx +++ b/src/components/CopyText/index.spec.tsx @@ -14,7 +14,7 @@ describe('', () => { }) it('should copy the value to clipboard and show text "Copiado!" whe clicked', () => { - render() + render() fireEvent.click(screen.getByTestId('copy-icon')) diff --git a/src/components/CopyText/index.tsx b/src/components/CopyText/index.tsx index 85ee8f7..60e31ca 100644 --- a/src/components/CopyText/index.tsx +++ b/src/components/CopyText/index.tsx @@ -4,16 +4,14 @@ import { useState } from 'react' import * as S from './styles' type CopyTextProps = { - value: { - value: string - } + value: string } const CopyText = ({ value }: CopyTextProps) => { const [isCopied, setIsCopied] = useState(false) const onCopy = () => { - navigator.clipboard.writeText(value?.value) + navigator.clipboard.writeText(value) setIsCopied(true) setTimeout(() => {