@tap-payments/auth-jsconnect 1.0.89-test → 1.0.91-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +50 -1
  2. package/build/api/availabilityServices.d.ts +2 -0
  3. package/build/api/axios.js +1 -2
  4. package/build/api/index.d.ts +2 -2
  5. package/build/api/index.js +2 -2
  6. package/build/components/Button/Button.d.ts +6 -1
  7. package/build/components/Button/Button.js +61 -23
  8. package/build/components/Footer/Footer.d.ts +0 -2
  9. package/build/components/Footer/Footer.js +0 -1
  10. package/build/constants/api.d.ts +3 -1
  11. package/build/constants/api.js +6 -2
  12. package/build/features/app/connect/connectStore.js +4 -2
  13. package/build/features/bank/screens/BankDetails/BankDetails.js +5 -1
  14. package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
  15. package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
  16. package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
  17. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  18. package/build/features/connect/screens/NID/NID.js +1 -1
  19. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +3 -3
  20. package/build/features/password/screens/CreatePassword/CreatePassword.js +5 -1
  21. package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +1 -1
  22. package/build/features/shared/Background/Background.js +3 -3
  23. package/build/features/shared/Background/LogoBackground.js +1 -4
  24. package/build/features/shared/Button/AbsherButton.d.ts +1 -2
  25. package/build/features/shared/Button/AbsherButton.js +12 -34
  26. package/build/features/shared/Button/EmailProvidersButtons.js +13 -49
  27. package/build/features/shared/Button/FlowsButtons.js +42 -42
  28. package/build/features/shared/Button/MobileButton.d.ts +1 -2
  29. package/build/features/shared/Button/MobileButton.js +10 -31
  30. package/build/features/shared/Button/SuccessButton.js +18 -16
  31. package/build/features/tax/screens/TaxDetails/TaxDetails.js +5 -1
  32. package/build/hooks/useAppConfig.js +11 -1
  33. package/build/theme/theme.js +10 -0
  34. package/build/utils/locale.js +2 -2
  35. package/build/utils/string.d.ts +1 -0
  36. package/build/utils/string.js +14 -0
  37. package/package.json +127 -126
@@ -17,6 +17,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
17
17
  import Box from '@mui/material/Box';
18
18
  import { styled } from '@mui/material/styles';
19
19
  import { useAppDispatch } from '../../../../hooks';
20
+ import { handleCurrentActiveScreen } from '../../../../app/settings';
20
21
  import Form from '../../../../components/Form';
21
22
  import { useLanguage } from '../../../../hooks';
22
23
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
@@ -44,6 +45,9 @@ var CreatePassword = function (_a) {
44
45
  var onSubmit = function (data) {
45
46
  dispatch(createPassword(data));
46
47
  };
47
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ disableBack: true, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
48
+ var onBack = function () {
49
+ dispatch(handleCurrentActiveScreen('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
50
+ };
51
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
48
52
  };
49
53
  export default React.memo(CreatePassword);
@@ -21,7 +21,7 @@ var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !
21
21
  var _b;
22
22
  var theme = _a.theme, enabled = _a.enabled, isAr = _a.isAr;
23
23
  return (_b = {
24
- backgroundColor: enabled ? alpha(theme.palette.success.main, 0.1) : alpha(theme.palette.text.primary, 0.1),
24
+ backgroundColor: enabled ? alpha(theme.palette.success.main, 0.1) : alpha(theme.palette.text.primary, 0.05),
25
25
  color: enabled ? theme.palette.success.main : alpha(theme.palette.text.primary, 0.6),
26
26
  borderRadius: theme.spacing(12.625),
27
27
  padding: theme.spacing(0.6, 1, 0.7, 1),
@@ -17,13 +17,13 @@ import LogoBackground from './LogoBackground';
17
17
  var BackgroundStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'isTapOrigin'; } })(function (_a) {
18
18
  var isTapOrigin = _a.isTapOrigin;
19
19
  return ({
20
- width: '100%',
21
- height: '100%',
20
+ width: '100vw',
21
+ height: '100vh',
22
22
  background: isTapOrigin ? 'linear-gradient(180deg, #98ABAF 0%, #D9D6CC 100%)' : 'rgba(0, 0, 0, 0.5)'
23
23
  });
24
24
  });
25
25
  var Background = function (_a) {
26
26
  var children = _a.children, isTapOrigin = _a.isTapOrigin, loading = _a.loading;
27
- return (_jsxs(BackgroundStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsx(LogoBackground, { hide: loading || !isTapOrigin }), children] })));
27
+ return (_jsxs(BackgroundStyled, __assign({ id: 'background', isTapOrigin: isTapOrigin }, { children: [_jsx(LogoBackground, { hide: loading || !isTapOrigin }), children] })));
28
28
  };
29
29
  export default memo(Background);
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { memo } from 'react';
14
- import { styled, useTheme } from '@mui/material/styles';
14
+ import { styled } from '@mui/material/styles';
15
15
  import Collapse from '@mui/material/Collapse';
16
16
  import Box from '@mui/material/Box';
17
17
  import Icon from '../../../components/Icon';
@@ -65,9 +65,6 @@ var LogoIconStyled = styled(Icon)(function (_a) {
65
65
  var LogoBackground = function (_a) {
66
66
  var hide = _a.hide;
67
67
  var isAr = useLanguage().isAr;
68
- var theme = useTheme();
69
- var style = getComputedStyle(document.body);
70
- console.log(style.getPropertyValue('--rsbs-overlay-h'));
71
68
  return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(BoxStyled, { children: [_jsx(LogoBadgeStyled, { src: ICONS_NAMES.TAP_LOGO_EN_ICON }), _jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_LOGO_TEXT_AR : ICONS_NAMES.TAP_LOGO_TEXT_EN, alt: 'tap logo' }) })] }) })));
72
69
  };
73
70
  export default memo(LogoBackground);
@@ -1,9 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonProps } from '../../../components/Button';
3
3
  interface AbsherButtonProps extends ButtonProps {
4
- isAr: boolean;
5
4
  loading?: boolean;
6
5
  hideIcon?: boolean;
7
6
  }
8
- export default function AbsherButton({ children, isAr, hideIcon, disabled, ...props }: AbsherButtonProps): JSX.Element;
7
+ export default function AbsherButton({ children, hideIcon, disabled, ...props }: AbsherButtonProps): JSX.Element;
9
8
  export {};
@@ -21,10 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import React from 'react';
25
24
  import Button from '../../../components/Button';
26
25
  import Icon from '../../../components/Icon';
27
- import { alpha, styled } from '@mui/material/styles';
26
+ import { styled, useTheme } from '@mui/material/styles';
28
27
  import Box from '@mui/material/Box';
29
28
  import { ICONS_NAMES } from '../../../constants';
30
29
  var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
@@ -34,40 +33,19 @@ var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop
34
33
  })));
35
34
  });
36
35
  var ButtonBoxStyled = styled(Box)(function (_a) {
36
+ var _b;
37
37
  var theme = _a.theme;
38
- return ({
39
- margin: theme.spacing(0, 2.5, 2.5, 2.5)
40
- });
41
- });
42
- var ButtonStyled = styled(Button, {
43
- shouldForwardProp: function (prop) { return prop !== 'hideIcon' && prop !== 'touched'; }
44
- })(function (_a) {
45
- var theme = _a.theme, hideIcon = _a.hideIcon, touched = _a.touched;
46
- return ({
47
- paddingInlineStart: theme.spacing(0.75),
48
- textTransform: 'none',
49
- backgroundColor: touched ? theme.palette.primary.light : theme.palette.common.white,
50
- border: "1px solid ".concat(hideIcon ? theme.palette.primary.main : theme.palette.primary.light),
51
- color: hideIcon ? theme.palette.primary.main : touched ? theme.palette.common.white : theme.palette.primary.light,
52
- '&:hover': {
53
- backgroundColor: touched ? theme.palette.primary.light : theme.palette.common.white,
54
- color: hideIcon ? theme.palette.primary.main : touched ? theme.palette.common.white : theme.palette.primary.light,
55
- img: {
56
- filter: touched ? 'brightness(0) invert(1)' : ''
57
- }
38
+ return (_b = {
39
+ margin: theme.spacing(0, 2.5, 2.5, 2.5)
58
40
  },
59
- '&:disabled': {
60
- backgroundColor: theme.palette.common.white,
61
- color: alpha(hideIcon ? theme.palette.primary.main : theme.palette.primary.light, 0.3),
62
- border: "1px solid ".concat(alpha(hideIcon ? theme.palette.primary.main : theme.palette.primary.light, 0.3))
63
- }
64
- });
41
+ _b[theme.breakpoints.down('sm')] = {
42
+ margin: theme.spacing(0, 2.5, 0.25, 2.5)
43
+ },
44
+ _b);
65
45
  });
66
46
  export default function AbsherButton(_a) {
67
- var children = _a.children, isAr = _a.isAr, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "isAr", "hideIcon", "disabled"]);
68
- var _b = React.useState(false), touched = _b[0], setTouched = _b[1];
69
- var handleTouch = function () {
70
- setTouched(true);
71
- };
72
- return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ onTouchStart: handleTouch, touched: touched, hideIcon: hideIcon, disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.ABSHER_LOGO }) }, props, { children: children })) }));
47
+ var children = _a.children, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "disabled"]);
48
+ var theme = useTheme();
49
+ var btnColor = theme.palette.primary.light;
50
+ return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ outLineColor: btnColor, variant: 'outlined', disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.ABSHER_LOGO }) }, props, { children: children })) }));
73
51
  }
@@ -10,9 +10,8 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import React from 'react';
14
13
  import Button from '../../../components/Button';
15
- import { alpha, styled } from '@mui/material/styles';
14
+ import { styled } from '@mui/material/styles';
16
15
  import Box from '@mui/material/Box';
17
16
  import Link from '@mui/material/Link';
18
17
  import { ICONS_NAMES } from '../../../constants';
@@ -26,72 +25,37 @@ var Image = styled('img')(function (_a) {
26
25
  });
27
26
  });
28
27
  var ButtonBoxStyled = styled(Box)(function (_a) {
28
+ var _b;
29
29
  var theme = _a.theme;
30
- return ({
31
- margin: theme.spacing(0, 2.5, 2.5, 2.5)
32
- });
30
+ return (_b = {
31
+ margin: theme.spacing(0, 2.5, 2.5, 2.5)
32
+ },
33
+ _b[theme.breakpoints.down('sm')] = {
34
+ margin: theme.spacing(0, 2.5, 0.25, 2.5)
35
+ },
36
+ _b);
33
37
  });
34
38
  var GMailButtonStyled = styled(Button)(function (_a) {
35
39
  var theme = _a.theme;
36
40
  return ({
37
41
  width: '100%',
38
- textTransform: 'none',
39
- paddingInlineStart: theme.spacing(0.75),
40
- marginBottom: theme.spacing(1.875),
41
- backgroundColor: theme.palette.common.white,
42
- border: "1px solid ".concat(theme.palette.primary.main),
43
- color: theme.palette.primary.main,
44
- '&:hover': {
45
- backgroundColor: theme.palette.primary.main,
46
- color: theme.palette.common.white
47
- },
48
- '&:disabled': {
49
- backgroundColor: theme.palette.common.white,
50
- color: alpha(theme.palette.primary.main, 0.3)
51
- }
42
+ marginBottom: theme.spacing(1.875)
52
43
  });
53
44
  });
54
45
  var OutlookButtonStyled = styled(Button)(function (_a) {
55
46
  var theme = _a.theme;
56
47
  return ({
57
- width: '100%',
58
- textTransform: 'none',
59
- paddingInlineStart: theme.spacing(0.75),
60
- backgroundColor: theme.palette.common.white,
61
- border: "1px solid ".concat(theme.palette.primary.main),
62
- color: theme.palette.primary.main,
63
- '&:hover': {
64
- backgroundColor: theme.palette.primary.main,
65
- color: theme.palette.common.white
66
- },
67
- '&:disabled': {
68
- backgroundColor: theme.palette.common.white,
69
- color: alpha(theme.palette.primary.main, 0.3)
70
- }
48
+ width: '100%'
71
49
  });
72
50
  });
73
51
  var AppleButtonStyled = styled(Button)(function (_a) {
74
52
  var theme = _a.theme;
75
53
  return ({
76
54
  width: '100%',
77
- textTransform: 'none',
78
- paddingInlineStart: theme.spacing(0.75),
79
- backgroundColor: theme.palette.common.white,
80
- border: "1px solid ".concat(theme.palette.primary.main),
81
- marginBottom: theme.spacing(1.875),
82
- color: theme.palette.primary.main,
83
- '&:hover': {
84
- backgroundColor: theme.palette.primary.main,
85
- color: theme.palette.common.white
86
- },
87
- '&:disabled': {
88
- backgroundColor: theme.palette.common.white,
89
- color: alpha(theme.palette.primary.main, 0.3)
90
- }
55
+ marginBottom: theme.spacing(1.875)
91
56
  });
92
57
  });
93
58
  export default function EmailProvidersButtons(_a) {
94
59
  var gmail = _a.gmail, outlook = _a.outlook, apple = _a.apple;
95
- var _b = React.useState(), index = _b[0], setIndex = _b[1];
96
- return (_jsxs(ButtonBoxStyled, { children: [_jsx(Link, __assign({ href: gmail.href, underline: 'none', target: '_blank', onMouseEnter: function () { return setIndex(0); }, onMouseLeave: function () { return setIndex(undefined); } }, { children: _jsx(GMailButtonStyled, __assign({ startIcon: _jsx(Image, { src: index === 0 ? ICONS_NAMES.GMAIL_White_ICON : ICONS_NAMES.GMAIL_Filled_ICON, alt: gmail.title }), type: 'button' }, { children: gmail.title })) })), _jsx(Link, __assign({ href: apple.href, underline: 'none', target: '_blank', onMouseEnter: function () { return setIndex(1); }, onMouseLeave: function () { return setIndex(undefined); } }, { children: _jsx(AppleButtonStyled, __assign({ startIcon: _jsx(Image, { src: index === 1 ? ICONS_NAMES.apple_white_icon : ICONS_NAMES.Apple_Filled_ICON, alt: apple.title }), type: 'button' }, { children: apple.title })) })), _jsx(Link, __assign({ href: outlook.href, underline: 'none', target: '_blank', onMouseEnter: function () { return setIndex(2); }, onMouseLeave: function () { return setIndex(undefined); } }, { children: _jsx(OutlookButtonStyled, __assign({ startIcon: _jsx(Image, { src: index === 2 ? ICONS_NAMES.outlook_White_ICON : ICONS_NAMES.outlook_Filled_ICON, alt: outlook.title }), type: 'button' }, { children: outlook.title })) }))] }));
60
+ return (_jsxs(ButtonBoxStyled, { children: [_jsx(Link, __assign({ href: gmail.href, underline: 'none', target: '_blank' }, { children: _jsx(GMailButtonStyled, __assign({ variant: 'outlined', startIcon: _jsx(Image, { src: ICONS_NAMES.GMAIL_Filled_ICON, alt: gmail.title }), type: 'button' }, { children: gmail.title })) })), _jsx(Link, __assign({ href: apple.href, underline: 'none', target: '_blank' }, { children: _jsx(AppleButtonStyled, __assign({ variant: 'outlined', startIcon: _jsx(Image, { src: ICONS_NAMES.Apple_Filled_ICON, alt: apple.title }), type: 'button' }, { children: apple.title })) })), _jsx(Link, __assign({ href: outlook.href, underline: 'none', target: '_blank' }, { children: _jsx(OutlookButtonStyled, __assign({ variant: 'outlined', startIcon: _jsx(Image, { src: ICONS_NAMES.outlook_Filled_ICON, alt: outlook.title }), type: 'button' }, { children: outlook.title })) }))] }));
97
61
  }
@@ -10,58 +10,70 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import React from 'react';
14
13
  import Button from '../../../components/Button';
15
- import { alpha, styled, useTheme } from '@mui/material/styles';
14
+ import { alpha, styled } from '@mui/material/styles';
16
15
  import Box from '@mui/material/Box';
17
16
  import Link from '@mui/material/Link';
18
17
  import { ICONS_NAMES } from '../../../constants';
19
18
  import CheckIcon from '@mui/icons-material/Check';
20
19
  import { useAppDispatch } from '../../../hooks';
21
20
  import { handleOpen } from '../../../app/settings';
22
- import useMediaQuery from '@mui/material/useMediaQuery';
23
- var Image = styled('img', { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
21
+ var Image = styled('img')(function (_a) {
24
22
  var theme = _a.theme;
25
23
  return ({
26
24
  width: theme.spacing(3),
27
25
  height: theme.spacing(3),
28
26
  fontSize: theme.spacing(3),
29
- marginInlineStart: theme.spacing(1),
30
- transform: theme.direction === 'rtl' ? 'scaleX(-1)' : 'scaleX(1)'
27
+ marginInlineStart: theme.spacing(1)
31
28
  });
32
29
  });
33
30
  var ButtonBoxStyled = styled(Box)(function (_a) {
31
+ var _b;
34
32
  var theme = _a.theme;
35
- return ({
36
- margin: theme.spacing(0, 2.5, 2.5, 2.5)
37
- });
33
+ return (_b = {
34
+ margin: theme.spacing(0, 2.5, 2.5, 2.5)
35
+ },
36
+ _b[theme.breakpoints.down('sm')] = {
37
+ margin: theme.spacing(0, 2.5, 0.25, 2.5)
38
+ },
39
+ _b);
38
40
  });
39
41
  var ButtonStyled = styled(Button, {
40
- shouldForwardProp: function (prop) { return !['isCompleted', 'touched'].includes(prop.toString()); }
42
+ shouldForwardProp: function (prop) { return prop !== 'isCompleted'; }
41
43
  })(function (_a) {
42
44
  var _b;
43
- var theme = _a.theme, isCompleted = _a.isCompleted, touched = _a.touched;
44
- return (__assign(__assign({ width: '100%', textTransform: 'none', paddingInlineStart: theme.spacing(0.75), backgroundColor: theme.palette.common.white, border: "1px solid ".concat(theme.palette.primary.main), color: theme.palette.primary.main }, (isCompleted && {
45
- paddingInlineEnd: theme.spacing(1.625),
46
- color: theme.palette.success.main,
47
- border: "1px solid ".concat(theme.palette.success.main)
48
- })), (_b = { '&:hover': __assign({ backgroundColor: theme.palette.primary.main, color: theme.palette.common.white }, (isCompleted && {
45
+ var theme = _a.theme, isCompleted = _a.isCompleted;
46
+ return ({
47
+ '&.MuiButton-outlined': __assign(__assign({}, (isCompleted && {
48
+ paddingInlineEnd: theme.spacing(1.625),
49
+ color: theme.palette.success.main,
50
+ border: "1px solid ".concat(theme.palette.success.main)
51
+ })), (_b = { '&:hover': __assign({}, (isCompleted && {
52
+ backgroundColor: theme.palette.common.white,
53
+ border: "1px solid ".concat(theme.palette.success.main),
54
+ color: theme.palette.success.main,
55
+ cursor: 'initial',
56
+ img: {
57
+ filter: 'none'
58
+ }
59
+ })) }, _b[theme.breakpoints.down('sm')] = {
60
+ '&:hover': __assign({ backgroundColor: theme.palette.common.white, border: "1px solid ".concat(theme.palette.primary.main), img: {
61
+ filter: 'none'
62
+ }, color: theme.palette.primary.main }, (isCompleted && {
49
63
  backgroundColor: theme.palette.common.white,
50
64
  border: "1px solid ".concat(theme.palette.success.main),
65
+ paddingInlineEnd: theme.spacing(1.625),
51
66
  color: theme.palette.success.main,
52
- cursor: 'initial'
53
- })) }, _b[theme.breakpoints.down('sm')] = {
54
- '&:hover': __assign({ backgroundColor: touched ? theme.palette.primary.main : theme.palette.common.white, border: "1px solid ".concat(theme.palette.primary.main), color: touched ? theme.palette.common.white : theme.palette.primary.main }, (isCompleted && {
67
+ cursor: 'initial',
68
+ img: {
69
+ filter: 'none'
70
+ }
71
+ }))
72
+ }, _b['&:disabled'] = {
55
73
  backgroundColor: theme.palette.common.white,
56
- border: "1px solid ".concat(theme.palette.success.main),
57
- paddingInlineEnd: theme.spacing(1.625),
58
- color: theme.palette.success.main,
59
- cursor: 'initial'
60
- }))
61
- }, _b['&:disabled'] = {
62
- backgroundColor: theme.palette.common.white,
63
- color: alpha(theme.palette.primary.main, 0.3)
64
- }, _b)));
74
+ color: alpha(theme.palette.primary.main, 0.3)
75
+ }, _b))
76
+ });
65
77
  });
66
78
  var CheckIconStyled = styled(CheckIcon)(function (_a) {
67
79
  var theme = _a.theme;
@@ -73,14 +85,7 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
73
85
  });
74
86
  export default function FlowsButtons(_a) {
75
87
  var buttons = _a.buttons;
76
- var _b = React.useState(), index = _b[0], setIndex = _b[1];
77
- var _c = React.useState(false), touched = _c[0], setTouched = _c[1];
78
88
  var dispatch = useAppDispatch();
79
- var theme = useTheme();
80
- var isMobile = useMediaQuery(theme.breakpoints.down('sm'));
81
- var handleTouch = function () {
82
- setTouched(true);
83
- };
84
89
  var onRedirect = function (item) {
85
90
  if (item.isCompleted)
86
91
  return;
@@ -92,13 +97,8 @@ export default function FlowsButtons(_a) {
92
97
  return (_jsx(ButtonBoxStyled, { children: buttons.map(function (_a, idx) {
93
98
  var title = _a.title, href = _a.href, src = _a.src, hoverSrc = _a.hoverSrc, isCompleted = _a.isCompleted, sx = _a.sx;
94
99
  var isLast = idx === buttons.length - 1;
95
- return (_jsx(Link, __assign({ underline: 'none', onMouseEnter: function () { return !isCompleted && setIndex(idx); }, onMouseLeave: function () { return setIndex(undefined); }, onClick: function () {
96
- setTouched(false);
100
+ return (_jsx(Link, __assign({ underline: 'none', onClick: function () {
97
101
  onRedirect({ title: title, href: href, src: src, hoverSrc: hoverSrc, isCompleted: isCompleted });
98
- } }, { children: _jsx(ButtonStyled, __assign({ onTouchStart: handleTouch, touched: touched, isCompleted: isCompleted, sx: __assign({ mb: isLast ? 0 : 1.8 }, sx), endIcon: isCompleted ? (_jsx(CheckIconStyled, {})) : isMobile ? (_jsx(Image, { sx: { height: 15 }, src: index === idx
99
- ? touched
100
- ? ICONS_NAMES.Arrow_white_right_icon
101
- : ICONS_NAMES.Arrow_filled_right_icon
102
- : ICONS_NAMES.Arrow_filled_right_icon })) : (_jsx(Image, { sx: { height: 15 }, src: index === idx ? ICONS_NAMES.Arrow_white_right_icon : ICONS_NAMES.Arrow_filled_right_icon })), startIcon: isMobile ? (_jsx(Image, { src: index === idx ? (touched ? hoverSrc : src) : src, alt: title })) : (_jsx(Image, { src: index === idx ? hoverSrc : src, alt: title })), type: 'button' }, { children: title })) }), idx));
102
+ } }, { children: _jsx(ButtonStyled, __assign({ variant: 'outlined', isCompleted: isCompleted, sx: __assign({ mb: isLast ? 0 : 1.8 }, sx), endIcon: isCompleted ? (_jsx(CheckIconStyled, {})) : (_jsx(Image, { sx: { height: 15, transform: 'unset' }, src: ICONS_NAMES.Arrow_filled_right_icon })), startIcon: _jsx(Image, { src: src, alt: title }), type: 'button' }, { children: title })) }), idx));
103
103
  }) }));
104
104
  }
@@ -1,9 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonProps } from '../../../components/Button';
3
3
  interface MobileButtonProps extends ButtonProps {
4
- isAr: boolean;
5
4
  loading?: boolean;
6
5
  hideIcon?: boolean;
7
6
  }
8
- export default function MobileButton({ children, isAr, hideIcon, disabled, ...props }: MobileButtonProps): JSX.Element;
7
+ export default function MobileButton({ children, hideIcon, disabled, ...props }: MobileButtonProps): JSX.Element;
9
8
  export {};
@@ -21,10 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import React from 'react';
25
24
  import Button from '../../../components/Button';
26
25
  import Icon from '../../../components/Icon';
27
- import { alpha, styled } from '@mui/material/styles';
26
+ import { styled } from '@mui/material/styles';
28
27
  import Box from '@mui/material/Box';
29
28
  import { ICONS_NAMES } from '../../../constants';
30
29
  var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
@@ -34,37 +33,17 @@ var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop
34
33
  })));
35
34
  });
36
35
  var ButtonBoxStyled = styled(Box)(function (_a) {
36
+ var _b;
37
37
  var theme = _a.theme;
38
- return ({
39
- margin: theme.spacing(0, 2.5, 2.5, 2.5)
40
- });
41
- });
42
- var ButtonStyled = styled(Button, { shouldForwardProp: function (prop) { return prop !== 'touched'; } })(function (_a) {
43
- var theme = _a.theme, touched = _a.touched;
44
- return ({
45
- paddingInlineStart: theme.spacing(0.75),
46
- textTransform: 'none',
47
- backgroundColor: touched ? theme.palette.primary.main : theme.palette.common.white,
48
- border: "1px solid ".concat(theme.palette.primary.main),
49
- color: touched ? theme.palette.common.white : theme.palette.primary.main,
50
- '&:hover': {
51
- backgroundColor: touched ? theme.palette.primary.main : theme.palette.common.white,
52
- color: touched ? theme.palette.common.white : theme.palette.primary.main,
53
- img: {
54
- filter: touched ? 'brightness(0) invert(1)' : ''
55
- }
38
+ return (_b = {
39
+ margin: theme.spacing(0, 2.5, 2.5, 2.5)
56
40
  },
57
- '&:disabled': {
58
- backgroundColor: theme.palette.common.white,
59
- color: alpha(theme.palette.primary.main, 0.3)
60
- }
61
- });
41
+ _b[theme.breakpoints.down('sm')] = {
42
+ margin: theme.spacing(0, 2.5, 0.25, 2.5)
43
+ },
44
+ _b);
62
45
  });
63
46
  export default function MobileButton(_a) {
64
- var children = _a.children, isAr = _a.isAr, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "isAr", "hideIcon", "disabled"]);
65
- var _b = React.useState(false), touched = _b[0], setTouched = _b[1];
66
- var handleTouch = function () {
67
- setTouched(true);
68
- };
69
- return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ onTouchStart: handleTouch, touched: touched, disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.MOBILE_ICON }) }, props, { children: children })) }));
47
+ var children = _a.children, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "disabled"]);
48
+ return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ disabled: disabled, type: 'button', variant: 'outlined', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.MOBILE_ICON }) }, props, { children: children })) }));
70
49
  }
@@ -26,23 +26,25 @@ import Button from './Button';
26
26
  import { styled } from '@mui/material/styles';
27
27
  import Box from '@mui/material/Box';
28
28
  var ButtonStyled = styled(Button, {
29
- shouldForwardProp: function (prop) { return prop !== 'isLoading'; }
29
+ shouldForwardProp: function (prop) { return !['isLoading', 'isAr'].includes(prop); }
30
30
  })(function (_a) {
31
31
  var theme = _a.theme, isLoading = _a.isLoading;
32
- return (__assign({ width: '100%', textTransform: 'none', paddingInlineStart: theme.spacing(0.75), backgroundColor: theme.palette.common.white, color: theme.palette.primary.main, border: "1px solid ".concat(theme.palette.primary.main), '&:hover': {
33
- backgroundColor: theme.palette.common.white,
34
- color: theme.palette.primary.main
35
- }, '&:disabled': {
36
- backgroundColor: theme.palette.primary.main,
37
- color: theme.palette.common.white
38
- }, transition: theme.transitions.create(['width', 'padding'], {
39
- easing: theme.transitions.easing.easeInOut,
40
- duration: theme.transitions.duration.complex * 2
41
- }) }, (isLoading && {
42
- minWidth: 0,
43
- width: theme.spacing(6),
44
- borderRadius: 30
45
- })));
32
+ return ({
33
+ '&.MuiButton-outlined': __assign({ width: '100%', textTransform: 'none', paddingInlineStart: theme.spacing(0.75), backgroundColor: theme.palette.common.white, color: theme.palette.primary.main, border: "1px solid ".concat(theme.palette.primary.main), '&:hover': {
34
+ backgroundColor: theme.palette.common.white,
35
+ color: theme.palette.primary.main
36
+ }, '&:disabled': {
37
+ backgroundColor: theme.palette.primary.main,
38
+ color: theme.palette.common.white
39
+ }, transition: theme.transitions.create(['width', 'padding'], {
40
+ easing: theme.transitions.easing.easeInOut,
41
+ duration: theme.transitions.duration.complex * 2
42
+ }) }, (isLoading && {
43
+ minWidth: 0,
44
+ width: theme.spacing(6),
45
+ borderRadius: 30
46
+ }))
47
+ });
46
48
  });
47
49
  var ButtonBoxStyled = styled(Box)(function (_a) {
48
50
  var theme = _a.theme;
@@ -62,5 +64,5 @@ export default function SuccessButton(_a) {
62
64
  React.useEffect(function () {
63
65
  setBtnLoading(false);
64
66
  }, []);
65
- return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr, isLoading: btnLoading, loading: btnLoading, disabled: disabled, type: 'button' }, props, { children: children })) }));
67
+ return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr, isLoading: btnLoading, loading: btnLoading, disabled: disabled, type: 'button', variant: 'outlined' }, props, { children: children })) }));
66
68
  }
@@ -20,6 +20,7 @@ import Form from '../../../../components/Form';
20
20
  import { Validation } from './validation';
21
21
  import { yupResolver } from '@hookform/resolvers/yup';
22
22
  import { taxSelector, updateTaxInfo } from '../../../app/tax/taxStore';
23
+ import { handleCurrentActiveScreen } from '../../../../app/settings';
23
24
  import VATId from './VATId';
24
25
  var FormStyled = styled(Form)(function () { return ({
25
26
  display: 'flex',
@@ -38,6 +39,9 @@ var TaxDetails = function () {
38
39
  var onSubmit = function (data) {
39
40
  dispatch(updateTaxInfo(data));
40
41
  };
41
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(Button, __assign({ disableBack: true, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
42
+ var onBack = function () {
43
+ dispatch(handleCurrentActiveScreen('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
44
+ };
45
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
42
46
  };
43
47
  export default TaxDetails;
@@ -60,8 +60,9 @@ import { useEffect, useState } from 'react';
60
60
  import { handleActiveFlowScreens, settingsSelector, getClientIp, getLocale, getBrowserFingerPrint, getOperator, handleSetAppConfig, handleLanguage, handleOpen, handleIsTapOrigin } from '../app/settings';
61
61
  import { useAppDispatch } from './useAppDispatch';
62
62
  import { useAppSelector } from './useAppSelector';
63
- import { setAxiosGlobalHeaders } from '../api';
63
+ import { setAxiosGlobalHeaders, axiosInstance } from '../api';
64
64
  import { getRequestHeaders, encryptString, isTapDomain } from '../utils';
65
+ import { ENDPOINT_PATHS } from '../constants';
65
66
  export var useAppConfig = function (_a) {
66
67
  var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, rest = __rest(_a, ["appInfo", "navigation", "publicKey"]);
67
68
  var _b = useState(true), loading = _b[0], setLoading = _b[1];
@@ -69,12 +70,21 @@ export var useAppConfig = function (_a) {
69
70
  var _c = useAppSelector(settingsSelector), data = _c.data, error = _c.error;
70
71
  var deviceInfo = data.deviceInfo, language = data.language, appConfig = data.appConfig;
71
72
  var device = deviceInfo.device, browser = deviceInfo.browser, connection = deviceInfo.connection;
73
+ var setBaseUrl = function () {
74
+ var isProd = publicKey.includes('pk_live');
75
+ if (isProd) {
76
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
77
+ return;
78
+ }
79
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
80
+ };
72
81
  var addAxiosHeader = function () {
73
82
  setAxiosGlobalHeaders(__assign(__assign({}, getRequestHeaders(deviceInfo)), { authorization: encryptString(publicKey), mdn: encryptString(window.location.origin) }));
74
83
  };
75
84
  var handleAppConfig = function () { return __awaiter(void 0, void 0, void 0, function () {
76
85
  return __generator(this, function (_a) {
77
86
  dispatch(handleSetAppConfig(__assign({ appInfo: appInfo, publicKey: publicKey }, rest)));
87
+ setBaseUrl();
78
88
  dispatch(handleActiveFlowScreens(navigation));
79
89
  return [2];
80
90
  });
@@ -3,11 +3,21 @@ import { typography } from './typography';
3
3
  import { darkPalette, lightPalette } from './palette';
4
4
  import { components } from './components';
5
5
  import { shadows } from './shadows';
6
+ import { isMobile } from 'react-device-detect';
6
7
  export var appTheme = function (mode, dir) {
7
8
  return createTheme({
8
9
  palette: mode === 'dark' ? darkPalette : lightPalette,
9
10
  direction: dir,
10
11
  typography: typography,
12
+ breakpoints: {
13
+ values: {
14
+ xs: 0,
15
+ sm: isMobile ? 1536 : 600,
16
+ md: 900,
17
+ lg: 1200,
18
+ xl: 1536
19
+ }
20
+ },
11
21
  components: components,
12
22
  shape: {
13
23
  borderRadius: 5
@@ -1,7 +1,7 @@
1
1
  import { initReactI18next } from 'react-i18next';
2
2
  import i18n from '../i18n';
3
3
  export var updateLocale = function (locale, country) {
4
- var data = locale[country] || locale['default'];
4
+ var data = locale[country.toUpperCase()] || locale['default'];
5
5
  if (i18n.isInitialized) {
6
6
  i18n.removeResourceBundle('*', 'translation');
7
7
  i18n.addResourceBundle('en', 'translation', data.en.translation);
@@ -9,7 +9,7 @@ export var updateLocale = function (locale, country) {
9
9
  }
10
10
  else {
11
11
  i18n.use(initReactI18next).init({
12
- resources: locale,
12
+ resources: data,
13
13
  fallbackLng: 'en',
14
14
  initImmediate: false,
15
15
  preload: ['ar', 'en'],
@@ -36,3 +36,4 @@ export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
36
36
  l: string;
37
37
  };
38
38
  export declare const removeRequestHeaders: () => void;
39
+ export declare const getBaseUrl: () => string;
@@ -1,5 +1,6 @@
1
1
  import { encryptString } from '.';
2
2
  import { removeAxiosGlobalHeaders } from '../api';
3
+ import { ENDPOINT_PATHS } from '../constants';
3
4
  export var maskPhone = function (str) {
4
5
  if (str === void 0) { str = ''; }
5
6
  var lastTwo = str.substring(str.length - 2, str.length);
@@ -120,3 +121,16 @@ export var removeRequestHeaders = function () {
120
121
  'authorization'
121
122
  ]);
122
123
  };
124
+ export var getBaseUrl = function () {
125
+ var origin = window.location.origin;
126
+ if (origin.includes('localhost')) {
127
+ return ENDPOINT_PATHS.DEV_BASE_URL;
128
+ }
129
+ if (origin.includes('dev')) {
130
+ return ENDPOINT_PATHS.DEV_BASE_URL;
131
+ }
132
+ if (origin.includes('sandbox')) {
133
+ return ENDPOINT_PATHS.SANDBOX_BASE_URL;
134
+ }
135
+ return ENDPOINT_PATHS.PRODUCTION_BASE_URL;
136
+ };