diff --git a/src/app/components/QRCode/index.tsx b/src/app/components/QRCode/index.tsx index ff0447617e..aaf6f7a0c4 100644 --- a/src/app/components/QRCode/index.tsx +++ b/src/app/components/QRCode/index.tsx @@ -1,4 +1,8 @@ +import { PopiconsCopyLine } from "@popicons/react"; import ReactQRCode from "react-qr-code"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import toast from "~/app/components/Toast"; import { classNames, useTheme } from "~/app/utils"; export type Props = { @@ -19,17 +23,40 @@ export type Props = { export default function QRCode({ value, size, level, className }: Props) { const theme = useTheme(); + const { t } = useTranslation("common"); + const fgColor = theme === "dark" ? "#FFFFFF" : "#000000"; const bgColor = theme === "dark" ? "#000000" : "#FFFFFF"; + function handleCopy(e: React.MouseEvent) { + e.stopPropagation(); // Stop the click from bubbling up + navigator.clipboard.writeText(value); + toast.success(t("copied")); + } + return ( - +
+ + + {/* Overlay: Hidden by default (opacity-0), Visible on hover (opacity-100) */} +
+
+ +
+
+
); } diff --git a/src/app/screens/Receive/index.tsx b/src/app/screens/Receive/index.tsx index a62b7b1d26..a0cb92f1f1 100644 --- a/src/app/screens/Receive/index.tsx +++ b/src/app/screens/Receive/index.tsx @@ -80,7 +80,7 @@ function Receive() { {!auth.accountLoading && auth.account ? ( @@ -89,7 +89,7 @@ function Receive() { ) )}