diff --git a/components/CopyToClipboard/CopyToClipboard.tsx b/components/CopyToClipboard/CopyToClipboard.tsx index e3f2a8a5f..8436b4002 100644 --- a/components/CopyToClipboard/CopyToClipboard.tsx +++ b/components/CopyToClipboard/CopyToClipboard.tsx @@ -1,33 +1,56 @@ -import useCopyToClipboard from 'hooks/useCopyToClipboard' -import React from 'react' -import { FaRegCopy } from 'react-icons/fa' -import { Tooltip } from 'react-tooltip' +import useCopyToClipboard from "hooks/useCopyToClipboard"; +import React from "react"; +import { FaRegCopy, FaCheckSquare } from "react-icons/fa"; +import { Tooltip } from "react-tooltip"; type CopyToClipboardProps = { - url: string -} + url: string; +}; export const CopyToClipboard = ({ url }: CopyToClipboardProps): JSX.Element => { - const [copyToClipboard, { success }] = useCopyToClipboard() + const [copyToClipboard, { success }] = useCopyToClipboard(); function handleCopy(e: React.MouseEvent) { - e.stopPropagation() - copyToClipboard(url) + e.stopPropagation(); + copyToClipboard(url); } return ( -
-
- - +
- ) -} + ); +} \ No newline at end of file diff --git a/components/Share/Share.tsx b/components/Share/Share.tsx index fdc17cb1c..320977ce1 100644 --- a/components/Share/Share.tsx +++ b/components/Share/Share.tsx @@ -1,62 +1,64 @@ -import React from 'react' -import { FiShare2 } from 'react-icons/fi' -import { Tooltip } from 'react-tooltip' +import React from "react"; +import { FiShare2 } from "react-icons/fi"; +import { Tooltip } from "react-tooltip"; type ShareProps = { - url: string - title: string -} + url: string; + title: string; +}; export const Share: React.FC = ({ url, title }) => { const showShareOptions = false - async function handleShare() { if (navigator.share) { try { await navigator.share({ title: title, url: url, - }) + }); } catch (error) { - console.error('Error sharing:', error) + console.error("Error sharing:", error); } } else { - console.log('Web Share API not supported on this browser.') + console.log("Web Share API not supported on this browser."); // Fallback behavior when Web Share API is not supported (e.g., open a new tab with the URL) - window.open(url, '_blank') + window.open(url, "_blank"); } } return (
- + backgroundColor: "#8b5cf6", + fontSize: "13px", + paddingLeft: "6px", + paddingRight: "6px", + paddingTop: "2px", + paddingBottom: "2px", + }} + /> + {showShareOptions && (

= ({ url, title }) => {

)}
- ) -} + ); +}; -export default Share +export default Share; \ No newline at end of file