From a2f42346ae97c7f477bdb5b4127d9fe8785a1a5c Mon Sep 17 00:00:00 2001 From: DIKER0K Date: Mon, 21 Jul 2025 17:02:26 +0500 Subject: [PATCH] fix: qrcode --- src/renderer/pages/Registration.tsx | 51 +++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/src/renderer/pages/Registration.tsx b/src/renderer/pages/Registration.tsx index 5e747fd..20766bb 100644 --- a/src/renderer/pages/Registration.tsx +++ b/src/renderer/pages/Registration.tsx @@ -108,7 +108,8 @@ function ColorlibStepIcon(props: StepIconProps) { const qrCode = new QRCodeStyling({ width: 300, height: 300, - // image: popalogo, + image: popalogo, + data: 'https://t.me/popa_popa_popa_bot?start=test', shape: 'square', margin: 10, dotsOptions: { @@ -125,7 +126,7 @@ const qrCode = new QRCodeStyling({ }, ], }, - type: 'rounded', + type: 'extra-rounded', }, imageOptions: { crossOrigin: 'anonymous', @@ -179,6 +180,45 @@ export const Registration = () => { handleGenerateVerificationCode(username); setUrl(`https://t.me/popa_popa_popa_bot?start=${username}`); + while (ref.current.firstChild) { + ref.current.removeChild(ref.current.firstChild); + } + + const newQrCode = new QRCodeStyling({ + width: 300, + height: 300, + image: popalogo, + data: 'https://t.me/popa_popa_popa_bot?start=test', + shape: 'square', + margin: 10, + dotsOptions: { + gradient: { + type: 'linear', + colorStops: [ + { + offset: 0, + color: 'rgb(242,113,33)', + }, + { + offset: 1, + color: 'rgb(233,64,87)', + }, + ], + }, + type: 'extra-rounded', + }, + imageOptions: { + crossOrigin: 'anonymous', + margin: 20, + imageSize: 0.5, + }, + backgroundOptions: { + color: 'transparent', + }, + }); + + newQrCode.append(ref.current); + const intervalId = setInterval(() => { handleVerifyCode(); }, 5000); @@ -340,7 +380,12 @@ export const Registration = () => { > Открыть бота -
+
Введите код верификации в боте