@tap-payments/auth-jsconnect 2.0.34-test → 2.0.36-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 (58) hide show
  1. package/build/@types/app.d.ts +9 -2
  2. package/build/@types/app.js +7 -0
  3. package/build/@types/form.d.ts +4 -3
  4. package/build/api/entity.d.ts +2 -0
  5. package/build/app/rootReducer.d.ts +1 -0
  6. package/build/app/rootReducer.js +3 -1
  7. package/build/app/store.d.ts +2 -0
  8. package/build/assets/locales/ar.json +8 -4
  9. package/build/assets/locales/en.json +8 -4
  10. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -1
  11. package/build/components/SocialMediaGroup/SocialMediaGroup.js +27 -34
  12. package/build/constants/app.d.ts +1 -0
  13. package/build/constants/app.js +8 -0
  14. package/build/constants/assets.d.ts +9 -1
  15. package/build/constants/assets.js +14 -6
  16. package/build/features/app/auth/authStore.d.ts +20 -0
  17. package/build/features/app/auth/authStore.js +101 -0
  18. package/build/features/app/connect/connectStore.d.ts +1 -0
  19. package/build/features/app/connect/connectStore.js +58 -4
  20. package/build/features/app/entity/entityStore.d.ts +5 -0
  21. package/build/features/app/entity/entityStore.js +149 -14
  22. package/build/features/auth/Auth.d.ts +8 -0
  23. package/build/features/auth/Auth.js +53 -0
  24. package/build/features/auth/index.d.ts +1 -0
  25. package/build/features/auth/index.js +1 -0
  26. package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
  27. package/build/features/auth/screens/OTP/OTP.js +72 -0
  28. package/build/features/auth/screens/OTP/OTPInput.d.ts +5 -0
  29. package/build/features/auth/screens/OTP/OTPInput.js +44 -0
  30. package/build/features/auth/screens/OTP/index.d.ts +3 -0
  31. package/build/features/auth/screens/OTP/index.js +2 -0
  32. package/build/features/auth/screens/OTP/validation.d.ts +8 -0
  33. package/build/features/auth/screens/OTP/validation.js +4 -0
  34. package/build/features/connect/screens/Merchant/Merchant.js +29 -9
  35. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +5 -0
  36. package/build/features/connect/screens/Merchant/SalesChannels.js +114 -0
  37. package/build/features/connect/screens/Merchant/SocialMedia.js +56 -11
  38. package/build/features/connect/screens/Merchant/validation.d.ts +87 -0
  39. package/build/features/connect/screens/Merchant/validation.js +68 -2
  40. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +54 -0
  41. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +139 -0
  42. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +52 -2
  43. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
  44. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
  45. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
  46. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
  47. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
  48. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
  49. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +5 -0
  50. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +112 -0
  51. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
  52. package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
  53. package/build/features/featuresScreens.d.ts +1 -0
  54. package/build/features/featuresScreens.js +9 -2
  55. package/build/hooks/useAppDispatch.d.ts +1 -0
  56. package/build/index.d.ts +3 -2
  57. package/build/index.js +5 -2
  58. package/package.json +128 -128
@@ -44,7 +44,13 @@ export interface FeatureScreenStep {
44
44
  export declare enum SocialMediaTypes {
45
45
  WEB = "website",
46
46
  INSTAGRAM = "instagram",
47
- TWITTER = "twitter"
47
+ TWITTER = "twitter",
48
+ SOCIAL = "social",
49
+ PHYSICAL_STORE = "physical store",
50
+ CALL_CENTER = "call center",
51
+ APP = "app",
52
+ APPLE_STORE = "apple store",
53
+ PLAY_STORE = "play store"
48
54
  }
49
55
  export interface CustomerLocation {
50
56
  id: string;
@@ -189,7 +195,8 @@ export declare enum FlowsTypes {
189
195
  PASSWORD = "password",
190
196
  TAX = "tax",
191
197
  ENTITY = "entity",
192
- OTP = "otp"
198
+ OTP = "otp",
199
+ AUTH = "auth"
193
200
  }
194
201
  export declare type FlowInfo = {
195
202
  name: string;
@@ -3,6 +3,12 @@ export var SocialMediaTypes;
3
3
  SocialMediaTypes["WEB"] = "website";
4
4
  SocialMediaTypes["INSTAGRAM"] = "instagram";
5
5
  SocialMediaTypes["TWITTER"] = "twitter";
6
+ SocialMediaTypes["SOCIAL"] = "social";
7
+ SocialMediaTypes["PHYSICAL_STORE"] = "physical store";
8
+ SocialMediaTypes["CALL_CENTER"] = "call center";
9
+ SocialMediaTypes["APP"] = "app";
10
+ SocialMediaTypes["APPLE_STORE"] = "apple store";
11
+ SocialMediaTypes["PLAY_STORE"] = "play store";
6
12
  })(SocialMediaTypes || (SocialMediaTypes = {}));
7
13
  export var BusinessType;
8
14
  (function (BusinessType) {
@@ -19,4 +25,5 @@ export var FlowsTypes;
19
25
  FlowsTypes["TAX"] = "tax";
20
26
  FlowsTypes["ENTITY"] = "entity";
21
27
  FlowsTypes["OTP"] = "otp";
28
+ FlowsTypes["AUTH"] = "auth";
22
29
  })(FlowsTypes || (FlowsTypes = {}));
@@ -24,6 +24,7 @@ export declare type IndividualFormValues = {
24
24
  };
25
25
  export declare type BrandFormValues = {
26
26
  brandName: string;
27
+ salesChannels: Array<SalesChannel>;
27
28
  links: {
28
29
  website: string;
29
30
  twitter: string;
@@ -75,9 +76,9 @@ export declare type PasswordCreateFormValues = {
75
76
  confirmPassword: string;
76
77
  };
77
78
  export declare type EntityFormValues = {
78
- licenseNumber: string;
79
- licenseName: string;
79
+ licenseNumber?: string;
80
+ licenseName?: string;
80
81
  activities?: Array<Activity>;
81
- salesChannels: Array<SalesChannel>;
82
+ salesChannels?: Array<SalesChannel>;
82
83
  operationStartDate: string;
83
84
  };
@@ -3,6 +3,8 @@ export declare type EntityInfoBody = {
3
3
  id: string;
4
4
  lead_id?: string;
5
5
  activities?: Array<string>;
6
+ license_name?: string;
7
+ license_number?: string;
6
8
  business_operation_start_at?: string;
7
9
  channel_services?: Array<string>;
8
10
  physical_store_available?: boolean;
@@ -9,5 +9,6 @@ declare const rootReducer: {
9
9
  signIn: import("redux").Reducer<import("../features/app/signIn/signInStore").SignInState, import("redux").AnyAction>;
10
10
  entity: import("redux").Reducer<import("../features/app/entity/entityStore").EntityState, import("redux").AnyAction>;
11
11
  otp: import("redux").Reducer<import("../features/app/otp/otpStore").OtpState, import("redux").AnyAction>;
12
+ auth: import("redux").Reducer<import("../features/app/auth/authStore").AuthState, import("redux").AnyAction>;
12
13
  };
13
14
  export default rootReducer;
@@ -8,6 +8,7 @@ import password from '../features/app/password/passwordStore';
8
8
  import signIn from '../features/app/signIn/signInStore';
9
9
  import entity from '../features/app/entity/entityStore';
10
10
  import otp from '../features/app/otp/otpStore';
11
+ import auth from '../features/app/auth/authStore';
11
12
  var rootReducer = {
12
13
  settings: settings,
13
14
  connect: connect,
@@ -18,6 +19,7 @@ var rootReducer = {
18
19
  password: password,
19
20
  signIn: signIn,
20
21
  entity: entity,
21
- otp: otp
22
+ otp: otp,
23
+ auth: auth
22
24
  };
23
25
  export default rootReducer;
@@ -10,6 +10,7 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
10
10
  signIn: import("../features/app/signIn/signInStore").SignInState;
11
11
  entity: import("../features/app/entity/entityStore").EntityState;
12
12
  otp: import("../features/app/otp/otpStore").OtpState;
13
+ auth: import("../features/app/auth/authStore").AuthState;
13
14
  }, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<{
14
15
  settings: import("./settings").SettingsState;
15
16
  connect: import("../features/app/connect/connectStore").ConnectState;
@@ -21,6 +22,7 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
21
22
  signIn: import("../features/app/signIn/signInStore").SignInState;
22
23
  entity: import("../features/app/entity/entityStore").EntityState;
23
24
  otp: import("../features/app/otp/otpStore").OtpState;
25
+ auth: import("../features/app/auth/authStore").AuthState;
24
26
  }, import("redux").AnyAction, undefined>]>>;
25
27
  export declare type AppDispatch = typeof store.dispatch;
26
28
  export declare type RootState = ReturnType<typeof store.getState>;
@@ -141,7 +141,7 @@
141
141
  "signup_email_placeholder": "مثل g@example.com",
142
142
  "signup_enter_mobile": "رقم الجوال",
143
143
  "signup_generic_error": "حدث خطأ ما يرجى إعادة المحاولة لاحقاً",
144
- "signup_instagram_placeholder": "حساب انستجرام",
144
+ "signup_instagram_placeholder": "Enter your Instagram handle",
145
145
  "signup_invalid_iqama_id_format": "يجب أن تبدأ الإقامة بالرقم {{number}}",
146
146
  "signup_invalid_national_id": "الرجاء ادخال رقم هوية صحيح",
147
147
  "signup_invalid_national_id_format": "يجب أن تبدأ الهوية الوطنية بالرقم {{number}}",
@@ -149,9 +149,9 @@
149
149
  "signup_merchant_name_label": "الاسم بالكامل",
150
150
  "signup_merchant_name_placeholder": "الاسم بالكامل",
151
151
  "signup_select_country": "دولتك",
152
- "signup_twitter_placeholder": "حساب تويتر",
152
+ "signup_twitter_placeholder": "Enter your Twitter handle",
153
153
  "signup_user_not_exists_error": "المستخدم غير مسجل مع تاب",
154
- "signup_website_placeholder": "رابط الموقع",
154
+ "signup_website_placeholder": "Enter your website URL",
155
155
  "signup_welcoming": "مرحبا {{username}},",
156
156
  "signup_welcoming_hi": "مرحبا,",
157
157
  "start_with_number": "رقم الجوال يجب ان يبدا ب {{number}}",
@@ -244,5 +244,9 @@
244
244
  "reset_password_success_title": "لقد ارسلنا رسالة بريدية إليك",
245
245
  "reset_password_success_description": "تحقق من بريدك الإلكتروني لإعادة تعيين كلمة المرور الخاصة بك.",
246
246
  "license_name_label": "اسم الرخصة",
247
- "email_button_label": "تواصل مع البريد الإلكتروني"
247
+ "email_button_label": "تواصل مع البريد الإلكتروني",
248
+ "apple_store_placeholder": "Enter your app name (iOS)",
249
+ "play_store_placeholder": "Enter your app name (Google Play Store)",
250
+ "physical_store_placeholder": "Enter your store address or Google Map URL",
251
+ "call_center_placeholder": "Enter your Call Center number"
248
252
  }
@@ -150,7 +150,7 @@
150
150
  "signup_email_placeholder": "Your Email address",
151
151
  "signup_enter_mobile": "Your mobile number",
152
152
  "signup_generic_error": "Something went wrong! Please try again later.",
153
- "signup_instagram_placeholder": "mybusiness",
153
+ "signup_instagram_placeholder": "Enter your Instagram handle",
154
154
  "signup_invalid_iqama_id_format": "May you please verify the entered identification number. (Note - Saudi Iqama's start with {{number}})",
155
155
  "signup_invalid_national_id": "May you please verify the entered identification number",
156
156
  "signup_invalid_national_id_format": "May you please verify the entered identification number. (Note - Saudi national IDs start with {{number}})",
@@ -158,9 +158,9 @@
158
158
  "signup_merchant_name_label": "Full name",
159
159
  "signup_merchant_name_placeholder": "Full name",
160
160
  "signup_select_country": "Your country of business",
161
- "signup_twitter_placeholder": "mybusiness",
161
+ "signup_twitter_placeholder": "Enter your Twitter handle",
162
162
  "signup_user_not_exists_error": "May you please verify the entered user.",
163
- "signup_website_placeholder": "www.mybusiness.com",
163
+ "signup_website_placeholder": "Enter your website URL",
164
164
  "signup_welcoming": "Hello {{username}},",
165
165
  "signup_welcoming_hi": "Hello,",
166
166
  "start_with_number": "May you please verify the entered mobile. (Note - mobile numbers start with {{number}})",
@@ -264,5 +264,9 @@
264
264
  "reset_password_success_title": "We sent you an email",
265
265
  "reset_password_success_description": "Check your email to reset your password.",
266
266
  "license_name_label": "License Name",
267
- "email_button_label": "Continue with Email"
267
+ "email_button_label": "Continue with Email",
268
+ "apple_store_placeholder": "Enter your app name (iOS)",
269
+ "play_store_placeholder": "Enter your app name (Google Play Store)",
270
+ "physical_store_placeholder": "Enter your store address or Google Map URL",
271
+ "call_center_placeholder": "Enter your Call Center number"
268
272
  }
@@ -4,9 +4,10 @@ import { ToggleButtonGroupProps } from '../ToggleButtonGroup';
4
4
  import { ToggleButtonProps } from '../ToggleButton';
5
5
  export interface SocialMediaGroupProps extends ToggleButtonGroupProps {
6
6
  toggleButtonProps?: ToggleButtonProps;
7
+ showSocialMediaTypes?: Array<SocialMediaTypes>;
7
8
  }
8
9
  declare const _default: React.MemoExoticComponent<{
9
- ({ children, defaultValue, onChange, toggleButtonProps, ...rest }: SocialMediaGroupProps): JSX.Element;
10
+ ({ children, defaultValue, onChange, toggleButtonProps, showSocialMediaTypes, ...rest }: SocialMediaGroupProps): JSX.Element;
10
11
  defaultProps: {
11
12
  defaultValue: SocialMediaTypes;
12
13
  };
@@ -25,60 +25,53 @@ import * as React from 'react';
25
25
  import { styled } from '@mui/material/styles';
26
26
  import { ICONS_NAMES } from '../../constants';
27
27
  import { SocialMediaTypes } from '../../@types';
28
+ import Fade from '@mui/material/Fade';
28
29
  import ToggleButtonGroup from '../ToggleButtonGroup';
29
30
  import ToggleButton from '../ToggleButton';
30
31
  import Icon from '../Icon';
31
- var WebToggleButton = styled(ToggleButton, {
32
- shouldForwardProp: function (prop) { return prop !== 'isActive'; }
32
+ var SocialMediaButtonStyled = styled(ToggleButton, {
33
+ shouldForwardProp: function (prop) { return prop !== 'isActive' && prop !== 'isShow'; }
33
34
  })(function (_a) {
34
- var theme = _a.theme, isActive = _a.isActive;
35
+ var theme = _a.theme, isActive = _a.isActive, isShow = _a.isShow;
35
36
  return ({
36
- borderBottom: isActive ? "".concat(theme.spacing(0.25), " solid #3A4154") : 'none'
37
+ borderBottom: isActive ? "".concat(theme.spacing(0.1875), " solid #3478F6") : 'none',
38
+ display: isShow ? 'inherit' : 'none',
39
+ transition: 'display 0.3s'
37
40
  });
38
41
  });
39
- var TwitterToggleButton = styled(ToggleButton, {
40
- shouldForwardProp: function (prop) { return prop !== 'isActive'; }
41
- })(function (_a) {
42
- var theme = _a.theme, isActive = _a.isActive;
43
- return ({
44
- borderBottom: isActive ? "".concat(theme.spacing(0.25), " solid #1DA1F2") : 'none'
45
- });
46
- });
47
- var InstagramToggleButton = styled(ToggleButton, {
48
- shouldForwardProp: function (prop) { return prop !== 'isActive'; }
49
- })(function (_a) {
50
- var theme = _a.theme, isActive = _a.isActive;
51
- return ({
52
- borderBottom: isActive ? "".concat(theme.spacing(0.25), " solid #8A3AB9") : 'none'
53
- });
54
- });
55
- var WebTwitterIconStyled = styled(Icon)(function (_a) {
42
+ var ToggleIconStyled = styled(Icon)(function (_a) {
56
43
  var theme = _a.theme;
57
44
  return ({
58
- width: theme.spacing(5.5),
59
- height: theme.spacing(5.5)
60
- });
61
- });
62
- var InstagramIconStyled = styled(Icon, {
63
- shouldForwardProp: function (prop) { return prop !== 'isActive'; }
64
- })(function (_a) {
65
- var theme = _a.theme, isActive = _a.isActive;
66
- return ({
67
- width: isActive ? '100%' : theme.spacing(5.5),
68
- height: isActive ? '100%' : theme.spacing(5.5)
45
+ width: theme.spacing(2.5),
46
+ height: theme.spacing(2.5)
69
47
  });
70
48
  });
71
49
  var SocialMediaGroupComponent = function (_a) {
72
- var children = _a.children, defaultValue = _a.defaultValue, onChange = _a.onChange, toggleButtonProps = _a.toggleButtonProps, rest = __rest(_a, ["children", "defaultValue", "onChange", "toggleButtonProps"]);
50
+ var children = _a.children, defaultValue = _a.defaultValue, onChange = _a.onChange, toggleButtonProps = _a.toggleButtonProps, showSocialMediaTypes = _a.showSocialMediaTypes, rest = __rest(_a, ["children", "defaultValue", "onChange", "toggleButtonProps", "showSocialMediaTypes"]);
73
51
  var _b = React.useState(defaultValue), socialMediaType = _b[0], setSocialMediaType = _b[1];
74
52
  var isWebActive = socialMediaType === SocialMediaTypes.WEB;
75
53
  var isTwitterActive = socialMediaType === SocialMediaTypes.TWITTER;
76
54
  var isInstagramActive = socialMediaType === SocialMediaTypes.INSTAGRAM;
55
+ var isAppleStoreActive = socialMediaType === SocialMediaTypes.APPLE_STORE;
56
+ var isPlayStoreActive = socialMediaType === SocialMediaTypes.PLAY_STORE;
57
+ var isCallCenterActive = socialMediaType === SocialMediaTypes.CALL_CENTER;
58
+ var isPhysicalStoreActive = socialMediaType === SocialMediaTypes.PHYSICAL_STORE;
77
59
  var handleOnChange = function (event, value) {
78
60
  setSocialMediaType(value);
79
61
  onChange === null || onChange === void 0 ? void 0 : onChange(event, value);
80
62
  };
81
- return (_jsxs(ToggleButtonGroup, __assign({ value: socialMediaType, exclusive: true }, rest, { onChange: handleOnChange }, { children: [children, " ||", _jsx(WebToggleButton, __assign({ isActive: isWebActive }, toggleButtonProps, { value: SocialMediaTypes.WEB }, { children: _jsx(WebTwitterIconStyled, { src: isWebActive ? ICONS_NAMES.WEB_ACTIVE_ICON : ICONS_NAMES.WEB_ICON }) })), _jsx(TwitterToggleButton, __assign({ isActive: isTwitterActive }, toggleButtonProps, { value: SocialMediaTypes.TWITTER }, { children: _jsx(WebTwitterIconStyled, { src: isTwitterActive ? ICONS_NAMES.TWITTER_ACTIVE_ICON : ICONS_NAMES.TWITTER_ICON }) })), _jsx(InstagramToggleButton, __assign({ isActive: isInstagramActive }, toggleButtonProps, { value: SocialMediaTypes.INSTAGRAM }, { children: _jsx(InstagramIconStyled, { isActive: isInstagramActive, src: isInstagramActive ? ICONS_NAMES.INSTAGRAM_ACTIVE_ICON : ICONS_NAMES.INSTAGRAM_ICON }) }))] })));
63
+ React.useEffect(function () {
64
+ if (defaultValue !== socialMediaType)
65
+ setSocialMediaType(defaultValue);
66
+ }, [defaultValue]);
67
+ var isShowWeb = !!(showSocialMediaTypes === null || showSocialMediaTypes === void 0 ? void 0 : showSocialMediaTypes.find(function (icon) { return icon === SocialMediaTypes.WEB; }));
68
+ var isShowTwitter = !!(showSocialMediaTypes === null || showSocialMediaTypes === void 0 ? void 0 : showSocialMediaTypes.find(function (icon) { return icon === SocialMediaTypes.TWITTER || icon === SocialMediaTypes.SOCIAL; }));
69
+ var isShowInstagram = !!(showSocialMediaTypes === null || showSocialMediaTypes === void 0 ? void 0 : showSocialMediaTypes.find(function (icon) { return icon === SocialMediaTypes.INSTAGRAM || icon === SocialMediaTypes.SOCIAL; }));
70
+ var isShowAppleStore = !!(showSocialMediaTypes === null || showSocialMediaTypes === void 0 ? void 0 : showSocialMediaTypes.find(function (icon) { return icon === SocialMediaTypes.APPLE_STORE || icon === SocialMediaTypes.APP; }));
71
+ var isShowPlayStore = !!(showSocialMediaTypes === null || showSocialMediaTypes === void 0 ? void 0 : showSocialMediaTypes.find(function (icon) { return icon === SocialMediaTypes.PLAY_STORE || icon === SocialMediaTypes.APP; }));
72
+ var isShowCallCenter = !!(showSocialMediaTypes === null || showSocialMediaTypes === void 0 ? void 0 : showSocialMediaTypes.find(function (icon) { return icon === SocialMediaTypes.CALL_CENTER; }));
73
+ var isShowPhysicalStore = !!(showSocialMediaTypes === null || showSocialMediaTypes === void 0 ? void 0 : showSocialMediaTypes.find(function (icon) { return icon === SocialMediaTypes.PHYSICAL_STORE; }));
74
+ return (_jsxs(ToggleButtonGroup, __assign({ value: socialMediaType, exclusive: true }, rest, { onChange: handleOnChange }, { children: [children, " ||", _jsx(SocialMediaButtonStyled, __assign({ isShow: isShowWeb, isActive: isWebActive }, toggleButtonProps, { value: SocialMediaTypes.WEB }, { children: _jsx(Fade, __assign({ in: isShowWeb }, { children: _jsx(ToggleIconStyled, { src: isWebActive ? ICONS_NAMES.WEB_ACTIVE_ICON : ICONS_NAMES.WEB_ICON }) })) })), _jsx(SocialMediaButtonStyled, __assign({ isShow: isShowAppleStore, isActive: isAppleStoreActive }, toggleButtonProps, { value: SocialMediaTypes.APPLE_STORE }, { children: _jsx(Fade, __assign({ in: isShowAppleStore }, { children: _jsx(ToggleIconStyled, { src: isAppleStoreActive ? ICONS_NAMES.APP_APPLE_ACTIVE_ICON : ICONS_NAMES.APP_APPLE_ICON }) })) })), _jsx(SocialMediaButtonStyled, __assign({ isShow: isShowPlayStore, isActive: isPlayStoreActive }, toggleButtonProps, { value: SocialMediaTypes.PLAY_STORE }, { children: _jsx(Fade, __assign({ in: isShowPlayStore }, { children: _jsx(ToggleIconStyled, { src: isPlayStoreActive ? ICONS_NAMES.APP_ANDROID_ACTIVE_ICON : ICONS_NAMES.APP_ANDROID_ICON }) })) })), _jsx(SocialMediaButtonStyled, __assign({ isShow: isShowPhysicalStore, isActive: isPhysicalStoreActive }, toggleButtonProps, { value: SocialMediaTypes.PHYSICAL_STORE }, { children: _jsx(Fade, __assign({ in: isShowPhysicalStore }, { children: _jsx(ToggleIconStyled, { src: isPhysicalStoreActive ? ICONS_NAMES.PHYSICAL_STORE_ACTIVE_ICON : ICONS_NAMES.PHYSICAL_STORE_ICON }) })) })), _jsx(SocialMediaButtonStyled, __assign({ isShow: isShowTwitter, isActive: isTwitterActive }, toggleButtonProps, { value: SocialMediaTypes.TWITTER }, { children: _jsx(Fade, __assign({ in: isShowTwitter }, { children: _jsx(ToggleIconStyled, { src: isTwitterActive ? ICONS_NAMES.TWITTER_ACTIVE_ICON : ICONS_NAMES.TWITTER_ICON }) })) })), _jsx(SocialMediaButtonStyled, __assign({ isShow: isShowInstagram, isActive: isInstagramActive }, toggleButtonProps, { value: SocialMediaTypes.INSTAGRAM }, { children: _jsx(Fade, __assign({ in: isShowInstagram }, { children: _jsx(ToggleIconStyled, { src: isInstagramActive ? ICONS_NAMES.INSTAGRAM_ACTIVE_ICON : ICONS_NAMES.INSTAGRAM_ICON }) })) })), _jsx(SocialMediaButtonStyled, __assign({ isShow: isShowCallCenter, isActive: isCallCenterActive }, toggleButtonProps, { value: SocialMediaTypes.CALL_CENTER }, { children: _jsx(Fade, __assign({ in: isShowCallCenter }, { children: _jsx(ToggleIconStyled, { src: isCallCenterActive ? ICONS_NAMES.CALL_CENTER_ACTIVE_ICON : ICONS_NAMES.CALL_CENTER_ICON }) })) }))] })));
82
75
  };
83
76
  export default React.memo(SocialMediaGroupComponent);
84
77
  SocialMediaGroupComponent.defaultProps = {
@@ -21,6 +21,7 @@ export declare const TAX_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
21
21
  export declare const SigIn_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
22
22
  export declare const ENTITY_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
23
23
  export declare const OTP_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
24
+ export declare const AUTH_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
24
25
  export declare const DefaultDeviceInfo: {
25
26
  source: string;
26
27
  device: {
@@ -319,6 +319,14 @@ export var OTP_SCREENS_NAVIGATION = [
319
319
  order: 1
320
320
  }
321
321
  ];
322
+ export var AUTH_SCREENS_NAVIGATION = [
323
+ {
324
+ name: 'AUTH_VERIFY_STEP',
325
+ next: '',
326
+ prev: '',
327
+ order: 1
328
+ }
329
+ ];
322
330
  export var DefaultDeviceInfo = {
323
331
  source: 'browser',
324
332
  device: {
@@ -20,11 +20,19 @@ export declare const ICONS_NAMES: {
20
20
  TWITTER_ICON: string;
21
21
  TWITTER_ACTIVE_ICON: string;
22
22
  INSTAGRAM_ICON: string;
23
+ INSTAGRAM_ACTIVE_ICON: string;
24
+ APP_APPLE_ICON: string;
25
+ APP_APPLE_ACTIVE_ICON: string;
26
+ APP_ANDROID_ICON: string;
27
+ APP_ANDROID_ACTIVE_ICON: string;
28
+ PHYSICAL_STORE_ICON: string;
29
+ PHYSICAL_STORE_ACTIVE_ICON: string;
30
+ CALL_CENTER_ICON: string;
31
+ CALL_CENTER_ACTIVE_ICON: string;
23
32
  FL_ICON: string;
24
33
  FL_ACTIVE_ICON: string;
25
34
  CR_ICON: string;
26
35
  CR_ACTIVE_ICON: string;
27
- INSTAGRAM_ACTIVE_ICON: string;
28
36
  TAP_LOGO_EN_ICON: string;
29
37
  TAP_LOGO_TEXT_AR: string;
30
38
  TAP_LOGO_TEXT_EN: string;
@@ -15,16 +15,24 @@ export var ICONS_NAMES = {
15
15
  DOWN_ARROW_ICON_DARK: ICONS_FULL_PATH + '/popup_arrow_dark' + ICONS_EXTENSION,
16
16
  CLEAR_ICON: ICONS_FULL_PATH + '/clear' + ICONS_EXTENSION,
17
17
  LOGO_ICON: ICONS_FULL_PATH + '/tap_logo_icon' + ICONS_EXTENSION,
18
- WEB_ICON: ICONS_FULL_PATH + '/web' + ICONS_EXTENSION,
19
- WEB_ACTIVE_ICON: ICONS_FULL_PATH + '/web-active' + ICONS_EXTENSION,
20
- TWITTER_ICON: ICONS_FULL_PATH + '/twitter' + ICONS_EXTENSION,
21
- TWITTER_ACTIVE_ICON: ICONS_FULL_PATH + '/twitter-active' + ICONS_EXTENSION,
22
- INSTAGRAM_ICON: ICONS_FULL_PATH + '/Insta' + ICONS_EXTENSION,
18
+ WEB_ICON: ICONS_FULL_PATH + '/website' + ICONS_EXTENSION,
19
+ WEB_ACTIVE_ICON: ICONS_FULL_PATH + '/website-active' + ICONS_EXTENSION,
20
+ TWITTER_ICON: ICONS_FULL_PATH + '/twitter-icon' + ICONS_EXTENSION,
21
+ TWITTER_ACTIVE_ICON: ICONS_FULL_PATH + '/twitter-active-icon' + ICONS_EXTENSION,
22
+ INSTAGRAM_ICON: ICONS_FULL_PATH + '/insta' + ICONS_EXTENSION,
23
+ INSTAGRAM_ACTIVE_ICON: ICONS_FULL_PATH + '/insta-active' + ICONS_EXTENSION,
24
+ APP_APPLE_ICON: ICONS_FULL_PATH + '/apple' + ICONS_EXTENSION,
25
+ APP_APPLE_ACTIVE_ICON: ICONS_FULL_PATH + '/apple-active' + ICONS_EXTENSION,
26
+ APP_ANDROID_ICON: ICONS_FULL_PATH + '/play-store' + ICONS_EXTENSION,
27
+ APP_ANDROID_ACTIVE_ICON: ICONS_FULL_PATH + '/play-store-active' + ICONS_EXTENSION,
28
+ PHYSICAL_STORE_ICON: ICONS_FULL_PATH + '/physical-store' + ICONS_EXTENSION,
29
+ PHYSICAL_STORE_ACTIVE_ICON: ICONS_FULL_PATH + '/physical-store-active' + ICONS_EXTENSION,
30
+ CALL_CENTER_ICON: ICONS_FULL_PATH + '/call-center' + ICONS_EXTENSION,
31
+ CALL_CENTER_ACTIVE_ICON: ICONS_FULL_PATH + '/call-center-active' + ICONS_EXTENSION,
23
32
  FL_ICON: ICONS_FULL_PATH + '/fl' + ICONS_EXTENSION,
24
33
  FL_ACTIVE_ICON: ICONS_FULL_PATH + '/fl_active' + ICONS_EXTENSION,
25
34
  CR_ICON: ICONS_FULL_PATH + '/cr' + ICONS_EXTENSION,
26
35
  CR_ACTIVE_ICON: ICONS_FULL_PATH + '/cr_active' + ICONS_EXTENSION,
27
- INSTAGRAM_ACTIVE_ICON: ICONS_FULL_PATH + '/Insta-active' + ICONS_EXTENSION,
28
36
  TAP_LOGO_EN_ICON: ICONS_FULL_PATH + '/tap-white-logo' + ICONS_EXTENSION,
29
37
  TAP_LOGO_TEXT_AR: ICONS_FULL_PATH + '/tap-white-text-ar' + ICONS_EXTENSION,
30
38
  TAP_LOGO_TEXT_EN: ICONS_FULL_PATH + '/tap-white-text-en' + ICONS_EXTENSION,
@@ -0,0 +1,20 @@
1
+ import { RootState } from '../../../app/store';
2
+ import { ResponseData, OTPFormValues, SharedState } from '../../../@types';
3
+ export declare const verifyAuth: import("@reduxjs/toolkit").AsyncThunk<{
4
+ formData: OTPFormValues;
5
+ }, OTPFormValues, {}>;
6
+ export interface AuthData extends ResponseData {
7
+ otp: string;
8
+ mobileNumber: string;
9
+ }
10
+ export interface AuthState extends SharedState<AuthData> {
11
+ }
12
+ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
13
+ clearError: (state: AuthState) => void;
14
+ stopLoader: (state: AuthState) => void;
15
+ resetOTPScreen: (state: AuthState) => void;
16
+ }, "auth/store">;
17
+ export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
18
+ declare const _default: import("redux").Reducer<AuthState, import("redux").AnyAction>;
19
+ export default _default;
20
+ export declare const authSelector: (state: RootState) => AuthState;
@@ -0,0 +1,101 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ var _a;
38
+ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
39
+ import { handleOpen } from '../../../app/settings';
40
+ export var verifyAuth = createAsyncThunk('verifyAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
41
+ var settings;
42
+ var _a, _b, _c, _d;
43
+ return __generator(this, function (_e) {
44
+ switch (_e.label) {
45
+ case 0:
46
+ settings = thunkApi.getState().settings;
47
+ return [4, new Promise(function (resolve) {
48
+ setTimeout(function () {
49
+ resolve(params);
50
+ }, 5000);
51
+ })];
52
+ case 1:
53
+ _e.sent();
54
+ (_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, params);
55
+ (_d = (_c = settings.data.appConfig).onFlowCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, { id: '' });
56
+ thunkApi.dispatch(handleOpen(false));
57
+ return [2, { formData: params }];
58
+ }
59
+ });
60
+ }); });
61
+ var initialState = {
62
+ error: null,
63
+ loading: false,
64
+ data: {
65
+ otp: '',
66
+ mobileNumber: ''
67
+ }
68
+ };
69
+ export var authSlice = createSlice({
70
+ name: 'auth/store',
71
+ initialState: initialState,
72
+ reducers: {
73
+ clearError: function (state) {
74
+ state.error = null;
75
+ },
76
+ stopLoader: function (state) {
77
+ state.loading = false;
78
+ },
79
+ resetOTPScreen: function (state) {
80
+ state.data.otp = '';
81
+ }
82
+ },
83
+ extraReducers: function (builder) {
84
+ builder
85
+ .addCase(verifyAuth.pending, function (state) {
86
+ state.loading = true;
87
+ state.error = null;
88
+ })
89
+ .addCase(verifyAuth.fulfilled, function (state) {
90
+ state.loading = false;
91
+ state.error = null;
92
+ })
93
+ .addCase(verifyAuth.rejected, function (state, action) {
94
+ state.loading = false;
95
+ state.error = action.error.message;
96
+ });
97
+ }
98
+ });
99
+ export var clearError = (_a = authSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen;
100
+ export default authSlice.reducer;
101
+ export var authSelector = function (state) { return state.auth; };
@@ -40,6 +40,7 @@ export declare const createLead: import("@reduxjs/toolkit").AsyncThunk<{
40
40
  stepName: string;
41
41
  }, {}>;
42
42
  export declare const retrieveBrandList: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
43
+ export declare const retrieveChannels: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
43
44
  export declare const updateLeadIndividual: import("@reduxjs/toolkit").AsyncThunk<{
44
45
  response: any;
45
46
  formData: IndividualFormValues;
@@ -207,7 +207,7 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
207
207
  return [4, API.authService.verifyAuth(payload)];
208
208
  case 1:
209
209
  data = (_e.sent()).data;
210
- if (!!data.errors) return [3, 4];
210
+ if (!!data.errors) return [3, 5];
211
211
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
212
212
  if (!(responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user)) return [3, 2];
213
213
  params_1 = {
@@ -215,9 +215,12 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
215
215
  stepName: 'CONNECT_INDIVIDUAL_STEP'
216
216
  };
217
217
  thunkApi.dispatch(retrieveLead(params_1));
218
- return [3, 4];
218
+ return [3, 5];
219
219
  case 2: return [4, thunkApi.dispatch(retrieveBrandList(data === null || data === void 0 ? void 0 : data.individual_id))];
220
220
  case 3:
221
+ _e.sent();
222
+ return [4, thunkApi.dispatch(retrieveChannels())];
223
+ case 4:
221
224
  _e.sent();
222
225
  if (!(data === null || data === void 0 ? void 0 : data.lead_id)) {
223
226
  params_2 = {
@@ -229,8 +232,8 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
229
232
  else {
230
233
  thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
231
234
  }
232
- _e.label = 4;
233
- case 4: return [2, { response: data, formData: params }];
235
+ _e.label = 5;
236
+ case 5: return [2, { response: data, formData: params }];
234
237
  }
235
238
  });
236
239
  }); });
@@ -282,6 +285,17 @@ export var retrieveBrandList = createAsyncThunk('retrieveBrandList', function (i
282
285
  }
283
286
  });
284
287
  }); });
288
+ export var retrieveChannels = createAsyncThunk('retrieveChannels', function () { return __awaiter(void 0, void 0, void 0, function () {
289
+ var data;
290
+ return __generator(this, function (_a) {
291
+ switch (_a.label) {
292
+ case 0: return [4, API.dataService.getChannelsOfServices()];
293
+ case 1:
294
+ data = (_a.sent()).data;
295
+ return [2, data];
296
+ }
297
+ });
298
+ }); });
285
299
  export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
286
300
  var _a, settings, connect, isAbsher, payload, data;
287
301
  var _b, _c, _d, _e, _f, _g;
@@ -316,6 +330,9 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
316
330
  return [4, API.leadService.updateLead(payload)];
317
331
  case 1:
318
332
  data = _h.sent();
333
+ return [4, thunkApi.dispatch(retrieveChannels())];
334
+ case 2:
335
+ _h.sent();
319
336
  thunkApi.dispatch(handleNextScreenStep());
320
337
  (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
321
338
  return [2, { response: data, formData: params }];
@@ -470,6 +487,7 @@ var initialState = {
470
487
  },
471
488
  brandData: {
472
489
  brandName: '',
490
+ salesChannels: [],
473
491
  termAndConditionChecked: false,
474
492
  links: {
475
493
  website: '',
@@ -768,6 +786,42 @@ export var connectSlice = createSlice({
768
786
  .addCase(updateLeadSuccess.rejected, function (state, action) {
769
787
  state.loading = false;
770
788
  state.error = action.error.message;
789
+ })
790
+ .addCase(retrieveChannels.pending, function (state) {
791
+ state.error = null;
792
+ state.loading = true;
793
+ })
794
+ .addCase(retrieveChannels.fulfilled, function (state, action) {
795
+ var _a;
796
+ state.error = null;
797
+ state.loading = false;
798
+ var data = action.payload || {};
799
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
800
+ if (description) {
801
+ state.error = description;
802
+ return;
803
+ }
804
+ var channels = data || [];
805
+ state.data.brandData.responseBody = __assign(__assign({}, state.data.brandData.responseBody), { channelList: channels });
806
+ var selectedChannels = [];
807
+ var selectedBrandItem = (state.data.brandData || {}).selectedBrandItem;
808
+ var _b = selectedBrandItem || {}, website = _b.website, social = _b.social;
809
+ var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
810
+ var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
811
+ var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
812
+ var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
813
+ var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
814
+ if (isHasWebsite && (isHasTwitter || isHasInstagram))
815
+ selectedChannels = [websiteData, socialData];
816
+ else if (isHasTwitter || isHasInstagram)
817
+ selectedChannels = [socialData];
818
+ else if (isHasWebsite)
819
+ selectedChannels = [websiteData];
820
+ state.data.brandData.salesChannels = selectedChannels;
821
+ })
822
+ .addCase(retrieveChannels.rejected, function (state, action) {
823
+ state.error = action.error.message;
824
+ state.loading = false;
771
825
  });
772
826
  }
773
827
  });
@@ -21,10 +21,15 @@ export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<
21
21
  export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<{
22
22
  data: any;
23
23
  }, string, {}>;
24
+ export declare const updateEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
25
+ data: any;
26
+ formData: EntityFormValues;
27
+ }, EntityFormValues, {}>;
24
28
  export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
25
29
  response: any;
26
30
  formData: void;
27
31
  } | undefined, void, {}>;
32
+ export declare const retrieveChannels: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
28
33
  declare type VerifyData = {
29
34
  token: string;
30
35
  };