diff --git a/src/components/Discours/Donate.tsx b/src/components/Discours/Donate.tsx index 2fd74ce0..afcdd1d5 100644 --- a/src/components/Discours/Donate.tsx +++ b/src/components/Discours/Donate.tsx @@ -20,7 +20,7 @@ export const Donate = () => { const [period, setPeriod] = createSignal(monthly) const [amount, setAmount] = createSignal(0) - onMount(() => { + const initiated = () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any const { cp: { CloudPayments } @@ -51,6 +51,16 @@ export const Donate = () => { provision: 0 // Сумма оплаты встречным предоставлением (сертификаты, др. мат.ценности) (2 знака после запятой) } }) + } + + onMount(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const script = document.createElement('script') + script.type = 'text/javascript' + script.src = 'https://widget.cloudpayments.ru/bundles/cloudpayments.js' + script.async = true + script.onload = initiated + document.head.appendChild(script) }) const show = () => { @@ -103,70 +113,68 @@ export const Donate = () => { } return ( - <> -