import { useEffect, useRef, useState } from "react"; import QRCodeStyling from "qr-code-styling"; import { observer } from "mobx-react-lite"; import styled from "styled-components"; import { BridgeReview } from "../../exchange"; import { PopupButton } from "../styles"; const DepositQR = observer(({ review, onConfirm, onCancel }: { review: BridgeReview; onConfirm: () => void; onCancel: () => void }) => { const qrCodeRef = useRef(null); const [qrCode] = useState(() => { if (review.qoute === "deposit" || review.qoute === "withdraw") return null; return new QRCodeStyling({ data: review.qoute.depositAddress, dotsOptions: { color: "#eeeeee", type: "rounded" }, backgroundOptions: { color: "transparent" }, shape: "circle", width: 180, height: 180, type: "svg", }); }); useEffect(() => { if (!qrCodeRef.current) return; if (review.qoute === "deposit" || review.qoute === "withdraw") return; qrCode?.append(qrCodeRef.current); }, []); if (review.qoute === "deposit" || review.qoute === "withdraw") return null; return (

Send{" "} {review.qoute.amountInFormatted} {review.from.symbol} {" "} on {review.from.chainName} to

{review.qoute.depositAddress}

I sent the funds
); }); const CloseButton = styled.button` position: absolute; top: -8px; right: -12px; background: transparent; border: none; cursor: pointer; padding: 6; border-radius: 50%; transition: background 0.2s; `; export default DepositQR;