develop #31

Merged
andrey.dekterev merged 2 commits from develop into master 3 years ago
  1. 1
      src/config/lexics/payment.tsx
  2. 8
      src/features/Matches/hooks.tsx
  3. 61
      src/features/UserAccount/components/CancelSubPopup/index.tsx
  4. 1
      src/requests/getUserSubscribes.tsx

@ -20,6 +20,7 @@ export const paymentLexics = {
error_empty_state: 19821, error_empty_state: 19821,
error_payment_unsuccessful: 14446, error_payment_unsuccessful: 14446,
if_you_cancel: 18189, if_you_cancel: 18189,
is_gpay: 20045,
next_payment: 18183, next_payment: 18183,
notify_by_email: 18366, notify_by_email: 18366,
order_received: 18365, order_received: 18365,

@ -13,8 +13,6 @@ import { useRequest } from 'hooks'
import { usePreferencesStore } from 'features/PreferencesPopup' import { usePreferencesStore } from 'features/PreferencesPopup'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
import { checkUrlParams } from 'helpers/parseUrlParams/parseUrlParams'
import { prepareMatches } from './helpers/prepareMatches' import { prepareMatches } from './helpers/prepareMatches'
export type Match = ReturnType<typeof prepareMatches>[number] export type Match = ReturnType<typeof prepareMatches>[number]
@ -68,10 +66,10 @@ export const useMatches = ({ fetch }: Props) => {
isFetching, isFetching,
]) ])
const dateParam = checkUrlParams('date')
useEffect(() => { useEffect(() => {
if (dateParam) { const isDefaultUrl = window.location.href.slice(0, -1) === window.location.origin
if (!isDefaultUrl) {
fetchMatches(0).then(setMatches) fetchMatches(0).then(setMatches)
pageRef.current = 1 pageRef.current = 1
} }

@ -43,12 +43,13 @@ export const CancelSubPopup = (props: Props) => {
const { const {
access_to, access_to,
is_gpay,
lexic, lexic,
option_sys_name, option_sys_name,
} = subscribe } = subscribe
return ( return (
<Modal isOpen={isModalOpen} withCloseButton={false}> <Modal isOpen={isModalOpen} withCloseButton={is_gpay}>
<Wrapper> <Wrapper>
{isSubCanceled || error ? ( {isSubCanceled || error ? (
<ScNotificationPopup> <ScNotificationPopup>
@ -65,32 +66,40 @@ export const CancelSubPopup = (props: Props) => {
</HeaderTitle> </HeaderTitle>
</Header> </Header>
<Body> <Body>
<Text> {is_gpay ? (
<T9n t='if_you_cancel' /> <Text>
</Text> <T9n t='is_gpay' />
<ScCancelSub> </Text>
{option_sys_name && `${option_sys_name[0].toUpperCase()}${option_sys_name.slice(1, option_sys_name.length)}`} <T9n t={lexic} /> ) : (
</ScCancelSub> <>
<Text> <Text>
<T9n t='after_canceling' /> <T9n t='if_you_cancel' />
</Text>
<ScCancelSub>
{option_sys_name && `${option_sys_name[0].toUpperCase()}${option_sys_name.slice(1, option_sys_name.length)}`} <T9n t={lexic} />
</ScCancelSub>
<Text>
<T9n t='after_canceling' />
&nbsp; &nbsp;
<b>{access_to && format(new Date(access_to), 'dd.MM.yyyy')}</b> <b>{access_to && format(new Date(access_to), 'dd.MM.yyyy')}</b>
</Text> </Text>
<Footer> <Footer>
<ScStillCancelBtn <ScStillCancelBtn
onClick={() => cancelSub()} onClick={() => cancelSub()}
isFetching={isFetching} isFetching={isFetching}
> >
{isFetching ? ( {isFetching ? (
<ArrowLoader /> <ArrowLoader />
) : ( ) : (
<T9n t='still_cancel' /> <T9n t='still_cancel' />
)} )}
</ScStillCancelBtn> </ScStillCancelBtn>
<ScSaveSubBtn onClick={() => handleModalClose()}> <ScSaveSubBtn onClick={() => handleModalClose()}>
<T9n t='save_sub' /> <T9n t='save_sub' />
</ScSaveSubBtn> </ScSaveSubBtn>
</Footer> </Footer>
</>
)}
</Body> </Body>
</> </>
)} )}

@ -12,6 +12,7 @@ export type Subscribe = {
dt_next_billing: string | null, dt_next_billing: string | null,
is_access: boolean, is_access: boolean,
is_active: boolean, is_active: boolean,
is_gpay?: boolean,
iso: string, iso: string,
lexic: number, lexic: number,
lexic1: number, lexic1: number,

Loading…
Cancel
Save