From 59242869ad45ca411ede5b7d1f5dc0a3cf2162d1 Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Fri, 15 Nov 2024 11:12:21 +0200 Subject: [PATCH] feat(docs): change icon for copy action --- src/components/RPCMethod.tsx | 10 ++++++---- src/components/buttons/CopyIcon.tsx | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 src/components/buttons/CopyIcon.tsx diff --git a/src/components/RPCMethod.tsx b/src/components/RPCMethod.tsx index 757bfad..1eedfb6 100644 --- a/src/components/RPCMethod.tsx +++ b/src/components/RPCMethod.tsx @@ -7,6 +7,8 @@ import SyntaxHighlighter from 'react-syntax-highlighter'; import { getExampleRequest } from '@/lib/helper'; import { Method, Param } from '@/lib/types'; +import CopyIcon from '@/components/buttons/CopyIcon'; + const RPCMethod = ({ pkg, method, @@ -71,14 +73,14 @@ const RPCMethod = ({ text={`${window.location.origin}/?version=${selectedVersion}#${pkg}.${method.name}`} onCopy={handleCopyClick} > - { window.location.hash = `${pkg}.${method.name}`; }} > - # - + +

{method.description}

diff --git a/src/components/buttons/CopyIcon.tsx b/src/components/buttons/CopyIcon.tsx new file mode 100644 index 0000000..69b810f --- /dev/null +++ b/src/components/buttons/CopyIcon.tsx @@ -0,0 +1,29 @@ +function CopyIcon({ + className = 'text-gray-500 hover:text-blue-500', +}: { + className?: string; +}) { + return ( + + + + + + + ); +} + +export default CopyIcon;