|
|
|
|
@ -12,8 +12,6 @@ import { MDASH } from 'config' |
|
|
|
|
import { payments } from 'config/payments' |
|
|
|
|
import { client } from 'config/clients' |
|
|
|
|
|
|
|
|
|
import { isSubscribePopup } from 'helpers' |
|
|
|
|
|
|
|
|
|
import { CountryCodeType, getCountryCode } from 'requests/getCountryCode' |
|
|
|
|
|
|
|
|
|
import { CloseButton, HeaderActions } from 'features/PopupComponents' |
|
|
|
|
@ -22,6 +20,7 @@ import { Name } from 'features/Name' |
|
|
|
|
import { useCardsStore } from 'features/CardsStore' |
|
|
|
|
import { ArrowLoader } from 'features/ArrowLoader' |
|
|
|
|
import { Arrow } from 'features/HeaderFilters/components/DateFilter/styled' |
|
|
|
|
import { useAuthStore } from 'features/AuthStore' |
|
|
|
|
|
|
|
|
|
import { IframePayment } from '../IframePayment' |
|
|
|
|
|
|
|
|
|
@ -45,6 +44,11 @@ export const PackageSelectionStep = () => { |
|
|
|
|
} = useCardsStore() |
|
|
|
|
const [isOpenIframe, setIsOpenIframe] = useState(false) |
|
|
|
|
const [countryCode, setCountryCode] = useState<CountryCodeType | null>(null) |
|
|
|
|
const { |
|
|
|
|
logout, |
|
|
|
|
setSearch, |
|
|
|
|
user, |
|
|
|
|
} = useAuthStore() |
|
|
|
|
|
|
|
|
|
const { |
|
|
|
|
close, |
|
|
|
|
@ -109,32 +113,30 @@ export const PackageSelectionStep = () => { |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Wrapper> |
|
|
|
|
{!isSubscribePopup |
|
|
|
|
&& ( |
|
|
|
|
<Header> |
|
|
|
|
{hasPreviousStep && ( |
|
|
|
|
<HeaderActions position='left'> |
|
|
|
|
<ButtonPrevious onClick={goBack}> |
|
|
|
|
<Arrow direction='left' /> |
|
|
|
|
</ButtonPrevious> |
|
|
|
|
</HeaderActions> |
|
|
|
|
)} |
|
|
|
|
<HeaderTitle> |
|
|
|
|
{hasPreviousStep && selectedSubscription ? ( |
|
|
|
|
<T9n t={selectedSubscription?.lexic} /> |
|
|
|
|
) : ( |
|
|
|
|
<Fragment> |
|
|
|
|
<Name nameObj={match.team1} /> |
|
|
|
|
{` ${MDASH} `} |
|
|
|
|
<Name nameObj={match.team2} /> |
|
|
|
|
</Fragment> |
|
|
|
|
)} |
|
|
|
|
</HeaderTitle> |
|
|
|
|
<HeaderActions position='right'> |
|
|
|
|
<CloseButton onClick={close} /> |
|
|
|
|
</HeaderActions> |
|
|
|
|
</Header> |
|
|
|
|
|
|
|
|
|
<Header> |
|
|
|
|
{hasPreviousStep && ( |
|
|
|
|
<HeaderActions position='left'> |
|
|
|
|
<ButtonPrevious onClick={goBack}> |
|
|
|
|
<Arrow direction='left' /> |
|
|
|
|
</ButtonPrevious> |
|
|
|
|
</HeaderActions> |
|
|
|
|
)} |
|
|
|
|
<HeaderTitle> |
|
|
|
|
{hasPreviousStep && selectedSubscription ? ( |
|
|
|
|
<T9n t={selectedSubscription?.lexic} /> |
|
|
|
|
) : ( |
|
|
|
|
<Fragment> |
|
|
|
|
<Name nameObj={match.team1} /> |
|
|
|
|
{` ${MDASH} `} |
|
|
|
|
<Name nameObj={match.team2} /> |
|
|
|
|
</Fragment> |
|
|
|
|
)} |
|
|
|
|
</HeaderTitle> |
|
|
|
|
<HeaderActions position='right'> |
|
|
|
|
<CloseButton onClick={close} /> |
|
|
|
|
</HeaderActions> |
|
|
|
|
</Header> |
|
|
|
|
<Body marginTop={20}> |
|
|
|
|
<Packages /> |
|
|
|
|
{!isIframePayment && <SelectedCard />} |
|
|
|
|
@ -145,7 +147,14 @@ export const PackageSelectionStep = () => { |
|
|
|
|
) : ( |
|
|
|
|
<Button |
|
|
|
|
disabled={!selectedPackage || disabledBuyBtn} |
|
|
|
|
onClick={onHandleClick} |
|
|
|
|
onClick={(e) => { |
|
|
|
|
if (user) { |
|
|
|
|
onHandleClick(e) |
|
|
|
|
} else { |
|
|
|
|
setSearch(window.location.search) |
|
|
|
|
logout('saveToken') |
|
|
|
|
} |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<T9n t='buy_subscription' /> |
|
|
|
|
</Button> |
|
|
|
|
|