fix(#2386): change logic for check country_code

keep-around/87c78c9d73943179f26bbafe8c20385ec61c221d
Andrei Dekterev 4 years ago
parent ed8a5ee2e2
commit adf1d1689c
  1. 4
      src/features/BuyMatchPopup/components/BrazilPayment/index.tsx
  2. 4
      src/features/BuyMatchPopup/components/BrazilPayment/styled.tsx
  3. 6
      src/features/BuyMatchPopup/components/PackageSelectionStep/index.tsx
  4. 6
      src/helpers/clientCountry/index.tsx

@ -8,8 +8,6 @@ import { Loader } from 'features/Loader'
import { useLexicsStore } from 'features/LexicsStore'
import { MatchPackage } from 'features/BuyMatchPopup/types'
import { isMobileDevice } from 'config/userAgent'
import { getBrazilPaymentUrl } from 'requests/getBrazilPaymentUrl'
import isNumber from 'lodash/isNumber'
@ -62,7 +60,7 @@ export const BrazilPayment = ({
return (
<ScModal isOpen={open} withCloseButton close={closePopup}>
{src && open ? (
<iframe title='BrazilPayment' src={src} height={600} width={isMobileDevice ? 350 : 700} />
<iframe title='BrazilPayment' src={src} height={600} width='100%' />
) : (
<LoaderWrapper>
<Loader color='#515151' />

@ -9,13 +9,15 @@ export const ScModal = styled(BaseModal)`
background-color: rgba(0, 0, 0, 0.7);
${ModalWindow} {
width: 800px;
padding: 50px;
background-color: #333333;
border-radius: 5px;
${isMobileDevice
? css`
width: calc(100vw - 60px);
padding: 50px 0px;
width: calc(100vw - 30px);
@media screen and (orientation: landscape){
max-width: calc(100vw - 80px);
height: calc(100vh - 60px);

@ -9,8 +9,7 @@ import isNull from 'lodash/isNull'
import { MDASH } from 'config'
import { clientCountry } from 'helpers/clientCountry'
import { useAuthStore } from 'features/AuthStore'
import { CloseButton, HeaderActions } from 'features/PopupComponents'
import { T9n } from 'features/T9n'
import { Name } from 'features/Name'
@ -36,6 +35,7 @@ import {
export const PackageSelectionStep = () => {
const { cards, fetchCards } = useCardsStore()
const [isOpenBrasilian, setIsOpenBrasilian] = useState(false)
const { user } = useAuthStore()
const {
close,
@ -56,7 +56,7 @@ export const PackageSelectionStep = () => {
if (!match) return null
const isBrasil = clientCountry() === 'BR'
const isBrasil = user?.profile.country_code === 'BR'
const onHandleClick = (e?: MouseEvent<HTMLButtonElement>) => {
if (isBrasil) {

@ -1,6 +0,0 @@
export const clientCountry = () => {
const country = JSON.parse(
localStorage.getItem('oidc.user:https://auth.instat.tv:ott-web') || 'oidc.user:https://test-auth.instat.tv:ott-web',
).profile.country_code
return country
}
Loading…
Cancel
Save