diff --git a/src/components/StarterPack/QrCode.tsx b/src/components/StarterPack/QrCode.tsx index 64c5cf50f7..ea6d1089e5 100644 --- a/src/components/StarterPack/QrCode.tsx +++ b/src/components/StarterPack/QrCode.tsx @@ -1,4 +1,4 @@ -import {lazy} from 'react' +import {lazy, useState} from 'react' import {View} from 'react-native' // @ts-expect-error missing types import QRCode from 'react-native-qrcode-styled' @@ -102,39 +102,74 @@ export function QrCode({ export function QrCodeInner({link}: {link: string}) { const t = useTheme() + const [logoArea, setLogoArea] = useState<{ + x: number + y: number + width: number + height: number + } | null>(null) + + const onLogoAreaChange = (area: { + x: number + y: number + width: number + height: number + }) => { + setLogoArea(area) + } return ( - + + {/* An SVG version of the logo is placed on top of normal `QRCode` `logo` prop, since the PNG fails to load before the export completes on web. */} + {isWeb && logoArea && ( + + + + )} + + ) }