diff --git a/src/features/BuyMatchPopup/components/IframePayment/hooks.tsx b/src/features/BuyMatchPopup/components/IframePayment/hooks.tsx index d55f8581..1a4860dc 100644 --- a/src/features/BuyMatchPopup/components/IframePayment/hooks.tsx +++ b/src/features/BuyMatchPopup/components/IframePayment/hooks.tsx @@ -104,7 +104,7 @@ export const useIframePayment = ({ } useEffect(() => { - const paymentCallback = (event: any) => { + const paymentCallback = (event: MessageEvent<{ event_id: string }>) => { if (event.data.event_id === 'paymee.complete') { closePopup() } diff --git a/src/features/JoinMatchPage/index.tsx b/src/features/JoinMatchPage/index.tsx index fcacaee9..7b137b51 100644 --- a/src/features/JoinMatchPage/index.tsx +++ b/src/features/JoinMatchPage/index.tsx @@ -1,5 +1,3 @@ -import format from 'date-fns/format' - import { joinMatchLexics } from 'config/lexics/joinMatch' import { usePageParams } from 'hooks/usePageParams' @@ -8,6 +6,8 @@ import { T9n } from 'features/T9n' import { Name } from 'features/Name' import { useLexicsConfig } from 'features/LexicsStore' +import { getCurrentYear } from 'helpers' + import { useUnauthenticatedMatch } from './hooks' import { @@ -45,7 +45,7 @@ export const JoinMatchPage = () => { onJoinClick, } = useUnauthenticatedMatch() - const currentYear = format(new Date(), 'Y') + const currentYear = getCurrentYear() return ( diff --git a/src/features/JoinMatchPageRFEF/index.tsx b/src/features/JoinMatchPageRFEF/index.tsx index 6a97f4cd..dfdb156e 100644 --- a/src/features/JoinMatchPageRFEF/index.tsx +++ b/src/features/JoinMatchPageRFEF/index.tsx @@ -1,11 +1,12 @@ import { useEffect } from 'react' -import format from 'date-fns/format' import { joinMatchLexics } from 'config/lexics/joinMatch' import { T9n } from 'features/T9n' import { useLexicsConfig, useLexicsStore } from 'features/LexicsStore' +import { getCurrentYear } from 'helpers' + import { useUnauthenticatedMatch } from './hooks' import { @@ -40,7 +41,7 @@ export const JoinMatchPageRFEF = () => { onJoinClick, } = useUnauthenticatedMatch() - const currentYear = format(new Date(), 'Y') + const currentYear = getCurrentYear() const { changeLang } = useLexicsStore() diff --git a/src/helpers/getCurrentYear/index.tsx b/src/helpers/getCurrentYear/index.tsx new file mode 100644 index 00000000..b20de05c --- /dev/null +++ b/src/helpers/getCurrentYear/index.tsx @@ -0,0 +1,3 @@ +import format from 'date-fns/format' + +export const getCurrentYear = () => format(new Date(), 'Y') diff --git a/src/helpers/index.tsx b/src/helpers/index.tsx index 734a5130..356fa282 100644 --- a/src/helpers/index.tsx +++ b/src/helpers/index.tsx @@ -8,3 +8,4 @@ export * from './secondsToHms' export * from './redirectToUrl' export * from './getRandomString' export * from './selectedApi' +export * from './getCurrentYear' diff --git a/src/pages/DiwanInsportsTv/index.tsx b/src/pages/DiwanInsportsTv/index.tsx index af01608e..a4e2cc7c 100644 --- a/src/pages/DiwanInsportsTv/index.tsx +++ b/src/pages/DiwanInsportsTv/index.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import { Fragment } from 'react' import format from 'date-fns/format' @@ -62,10 +62,10 @@ export const DiwanInsportsTv = () => { {!isMobileDevice && ( - + - + )} diff --git a/src/pages/Mailings/index.tsx b/src/pages/Mailings/index.tsx index a84b649d..ddea85d6 100644 --- a/src/pages/Mailings/index.tsx +++ b/src/pages/Mailings/index.tsx @@ -2,8 +2,6 @@ import { useState } from 'react' import { Link } from 'react-router-dom' -import { format } from 'date-fns' - import { PAGES } from 'config' import { saveUserInfo } from 'requests' @@ -11,6 +9,8 @@ import { saveUserInfo } from 'requests' import { T9n } from 'features/T9n' import { useAuthStore } from 'features/AuthStore' +import { getCurrentYear } from 'helpers' + import { Body, ButtonsBlock, @@ -35,7 +35,7 @@ const Mailings = () => { if (!userInfo) return null - const currentYear = format(new Date(), 'Y') + const currentYear = getCurrentYear() const onUnsubscribe = async (isUnsubscribed: boolean) => { if (!isUnsubscribed) {