|
|
|
|
@ -1,4 +1,8 @@ |
|
|
|
|
import { useEffect, useState } from 'react' |
|
|
|
|
import { |
|
|
|
|
useEffect, |
|
|
|
|
useState, |
|
|
|
|
MouseEvent, |
|
|
|
|
} from 'react' |
|
|
|
|
|
|
|
|
|
import { Loader } from 'features/Loader' |
|
|
|
|
import { useLexicsStore } from 'features/LexicsStore' |
|
|
|
|
@ -15,6 +19,7 @@ import { ScModal, LoaderWrapper } from './styled' |
|
|
|
|
type Props = { |
|
|
|
|
open: boolean, |
|
|
|
|
selectedPackage: MatchPackage, |
|
|
|
|
setIsOpenBrasilian: (open: boolean) => void, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type ResponsePayment = { |
|
|
|
|
@ -26,6 +31,7 @@ type ResponsePaymentArray =Array<ResponsePayment | null> |
|
|
|
|
export const BrazilPayment = ({ |
|
|
|
|
open, |
|
|
|
|
selectedPackage, |
|
|
|
|
setIsOpenBrasilian, |
|
|
|
|
}: Props) => { |
|
|
|
|
const { |
|
|
|
|
name, |
|
|
|
|
@ -38,6 +44,11 @@ export const BrazilPayment = ({ |
|
|
|
|
const teams = isNumber(nameLexic) ? translate(String(nameLexic)) : name |
|
|
|
|
const pack = translate(String(pass)) |
|
|
|
|
|
|
|
|
|
const closePopup = (e?: MouseEvent) => { |
|
|
|
|
e?.stopPropagation() |
|
|
|
|
setIsOpenBrasilian(false) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (open) { |
|
|
|
|
(async () => { |
|
|
|
|
@ -49,9 +60,9 @@ export const BrazilPayment = ({ |
|
|
|
|
}, [selectedPackage, open]) |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<ScModal isOpen={open} withCloseButton={false}> |
|
|
|
|
<ScModal isOpen={open} withCloseButton close={closePopup}> |
|
|
|
|
{src && open ? ( |
|
|
|
|
<iframe title='BrazilPayment' src={src} height={600} width={isMobileDevice ? 350 : 800} /> |
|
|
|
|
<iframe title='BrazilPayment' src={src} height={600} width={isMobileDevice ? 350 : 700} /> |
|
|
|
|
) : ( |
|
|
|
|
<LoaderWrapper> |
|
|
|
|
<Loader color='#515151' /> |
|
|
|
|
|