@tap-payments/auth-jsconnect 1.0.2 → 1.0.5
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.
- package/build/@types/app.d.ts +16 -0
- package/build/@types/app.js +6 -2
- package/build/@types/index.js +0 -1
- package/build/@types/redux.js +0 -1
- package/build/@types/theme.d.ts +12 -3
- package/build/@types/theme.js +15 -2
- package/build/app/rootReducer.d.ts +1 -1
- package/build/app/rootReducer.js +1 -2
- package/build/app/settings.d.ts +7 -2
- package/build/app/settings.js +21 -7
- package/build/app/store.d.ts +2 -2
- package/build/app/store.js +0 -1
- package/build/assets/locales/ar.json +22 -3
- package/build/assets/locales/en.json +20 -1
- package/build/components/AnimationFlow/AnimationFlow.js +15 -5
- package/build/components/AnimationFlow/BottomSheet.d.ts +3 -2
- package/build/components/AnimationFlow/BottomSheet.js +43 -5
- package/build/components/AnimationFlow/Dialog.d.ts +3 -2
- package/build/components/AnimationFlow/Dialog.js +35 -18
- package/build/components/AnimationFlow/index.js +0 -1
- package/build/components/Button/Button.d.ts +7 -3
- package/build/components/Button/Button.js +21 -3
- package/build/components/Button/index.js +0 -1
- package/build/components/CheckBox/CheckBox.js +2 -2
- package/build/components/CheckBox/index.js +0 -1
- package/build/components/Collapse/Collapse.d.ts +5 -0
- package/build/components/Collapse/Collapse.js +28 -0
- package/build/components/Collapse/index.d.ts +3 -0
- package/build/components/Collapse/index.js +2 -0
- package/build/components/DatePicker/DatePicker.js +10 -14
- package/build/components/DatePicker/index.js +0 -1
- package/build/components/Footer/Footer.js +2 -16
- package/build/components/Footer/index.js +0 -1
- package/build/components/Form/Form.js +2 -2
- package/build/components/Form/index.js +0 -1
- package/build/components/Icon/Icon.js +2 -2
- package/build/components/Icon/index.js +0 -1
- package/build/components/Input/Input.d.ts +4 -1
- package/build/components/Input/Input.js +8 -7
- package/build/components/Input/index.js +0 -1
- package/build/components/InputAdornment/InputAdornment.js +3 -3
- package/build/components/InputAdornment/index.js +0 -1
- package/build/components/List/List.js +2 -4
- package/build/components/List/index.js +0 -1
- package/build/components/ListItem/ListItem.js +2 -2
- package/build/components/ListItem/index.js +0 -1
- package/build/components/Loader/Loader.d.ts +10 -8
- package/build/components/Loader/Loader.js +25 -43
- package/build/components/Loader/index.js +0 -1
- package/build/components/LogoBadge/LogoBadge.js +4 -5
- package/build/components/LogoBadge/index.js +0 -1
- package/build/components/OTPField/OTPField.js +2 -2
- package/build/components/OTPField/index.js +0 -1
- package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
- package/build/components/OTPTimer/OTPTimer.js +6 -8
- package/build/components/OTPTimer/index.js +0 -1
- package/build/components/ProgressBar/ProgressBar.js +2 -3
- package/build/components/ProgressBar/index.js +0 -1
- package/build/components/Providers/ReduxProvider.js +13 -3
- package/build/components/Providers/ThemeProvider.js +18 -10
- package/build/components/Providers/index.js +0 -1
- package/build/components/SimpleList/SimpleList.d.ts +10 -2
- package/build/components/SimpleList/SimpleList.js +58 -26
- package/build/components/SimpleList/index.js +0 -1
- package/build/components/Slide/Slide.d.ts +6 -0
- package/build/components/Slide/Slide.js +30 -0
- package/build/components/Slide/index.d.ts +3 -0
- package/build/components/Slide/index.js +2 -0
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +14 -0
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +86 -0
- package/build/components/SocialMediaGroup/index.d.ts +3 -0
- package/build/components/SocialMediaGroup/index.js +2 -0
- package/build/components/Text/Text.js +2 -2
- package/build/components/Text/index.js +0 -1
- package/build/components/ToggleButton/ToggleButton.d.ts +5 -0
- package/build/components/ToggleButton/ToggleButton.js +44 -0
- package/build/components/ToggleButton/index.d.ts +3 -0
- package/build/components/ToggleButton/index.js +2 -0
- package/build/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +5 -0
- package/build/components/ToggleButtonGroup/ToggleButtonGroup.js +37 -0
- package/build/components/ToggleButtonGroup/index.d.ts +3 -0
- package/build/components/ToggleButtonGroup/index.js +2 -0
- package/build/components/Tooltip/Tooltip.d.ts +10 -0
- package/build/components/Tooltip/Tooltip.js +44 -0
- package/build/components/Tooltip/index.d.ts +3 -0
- package/build/components/Tooltip/index.js +2 -0
- package/build/components/Warning/Warning.d.ts +2 -1
- package/build/components/Warning/Warning.js +4 -3
- package/build/components/Warning/index.js +0 -1
- package/build/constants/app.d.ts +5 -4
- package/build/constants/app.js +35 -5
- package/build/constants/assets.d.ts +7 -0
- package/build/constants/assets.js +8 -2
- package/build/constants/dummy.js +0 -1
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -1
- package/build/constants/validation.d.ts +2 -0
- package/build/constants/validation.js +2 -0
- package/build/features/app/{midStore.d.ts → business/midStore.d.ts} +2 -2
- package/build/features/app/{midStore.js → business/midStore.js} +0 -1
- package/build/features/app/connect/midStore.d.ts +10 -0
- package/build/features/app/connect/midStore.js +18 -0
- package/build/features/business/index.d.ts +0 -0
- package/build/features/business/index.js +1 -0
- package/build/features/business/screens/IDBOD/DOB.d.ts +5 -0
- package/build/features/business/screens/IDBOD/DOB.js +44 -0
- package/build/features/business/screens/IDBOD/ID.d.ts +5 -0
- package/build/features/business/screens/IDBOD/ID.js +68 -0
- package/build/features/business/screens/IDBOD/IDBOD.d.ts +5 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +86 -0
- package/build/features/business/screens/IDBOD/index.d.ts +3 -0
- package/build/features/business/screens/IDBOD/index.js +2 -0
- package/build/features/business/screens/IDBOD/validation.d.ts +11 -0
- package/build/features/business/screens/IDBOD/validation.js +5 -0
- package/build/features/connect/Connect.js +31 -25
- package/build/features/connect/Footer.d.ts +4 -0
- package/build/features/connect/Footer.js +16 -0
- package/build/features/connect/index.js +0 -1
- package/build/features/connect/screens/Individual/Email.d.ts +5 -0
- package/build/features/connect/screens/Individual/Email.js +56 -0
- package/build/features/connect/screens/Individual/Individual.d.ts +5 -0
- package/build/features/connect/screens/Individual/Individual.js +86 -0
- package/build/features/connect/screens/Individual/Name.d.ts +5 -0
- package/build/features/connect/screens/Individual/Name.js +58 -0
- package/build/features/connect/screens/Individual/index.d.ts +3 -0
- package/build/features/connect/screens/Individual/index.js +2 -0
- package/build/features/connect/screens/Individual/validation.d.ts +11 -0
- package/build/features/connect/screens/Individual/validation.js +5 -0
- package/build/features/connect/screens/MID/BusinessCountry.d.ts +2 -6
- package/build/features/connect/screens/MID/BusinessCountry.js +18 -53
- package/build/features/connect/screens/MID/IDNumber.d.ts +0 -4
- package/build/features/connect/screens/MID/IDNumber.js +28 -22
- package/build/features/connect/screens/MID/MID.js +85 -27
- package/build/features/connect/screens/MID/MIDTitle.js +3 -5
- package/build/features/connect/screens/MID/MobileNumber.d.ts +2 -7
- package/build/features/connect/screens/MID/MobileNumber.js +28 -69
- package/build/features/connect/screens/MID/index.js +0 -1
- package/build/features/connect/screens/MID/validation.d.ts +18 -0
- package/build/features/connect/screens/MID/validation.js +8 -0
- package/build/features/connect/screens/Merchant/BrandName.d.ts +5 -0
- package/build/features/connect/screens/Merchant/BrandName.js +99 -0
- package/build/features/connect/screens/Merchant/Merchant.d.ts +5 -0
- package/build/features/connect/screens/Merchant/Merchant.js +94 -0
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +5 -0
- package/build/features/connect/screens/Merchant/SocialMedia.js +87 -0
- package/build/features/connect/screens/Merchant/TAC.d.ts +5 -0
- package/build/features/connect/screens/Merchant/TAC.js +88 -0
- package/build/features/connect/screens/Merchant/index.d.ts +3 -0
- package/build/features/connect/screens/Merchant/index.js +2 -0
- package/build/features/connect/screens/Merchant/validation.d.ts +50 -0
- package/build/features/connect/screens/Merchant/validation.js +23 -0
- package/build/features/connect/screens/OTP/OTP.d.ts +6 -2
- package/build/features/connect/screens/OTP/OTP.js +76 -32
- package/build/features/connect/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/connect/screens/OTP/OTPInput.js +51 -0
- package/build/features/connect/screens/OTP/OTPTimer.d.ts +5 -0
- package/build/features/connect/screens/OTP/OTPTimer.js +35 -0
- package/build/features/connect/screens/OTP/index.js +0 -1
- package/build/features/connect/screens/OTP/validation.d.ts +8 -0
- package/build/features/connect/screens/OTP/validation.js +4 -0
- package/build/features/connect/screens/Password/Password.d.ts +5 -0
- package/build/features/connect/screens/Password/Password.js +86 -0
- package/build/features/connect/screens/Password/PasswordInput.d.ts +5 -0
- package/build/features/connect/screens/Password/PasswordInput.js +73 -0
- package/build/features/connect/screens/Password/index.d.ts +3 -0
- package/build/features/connect/screens/Password/index.js +2 -0
- package/build/features/connect/screens/Password/validation.d.ts +8 -0
- package/build/features/connect/screens/Password/validation.js +4 -0
- package/build/features/connect/screens/ThankYou/ThankYou.d.ts +5 -0
- package/build/features/connect/screens/ThankYou/ThankYou.js +76 -0
- package/build/features/connect/screens/ThankYou/index.d.ts +3 -0
- package/build/features/connect/screens/ThankYou/index.js +2 -0
- package/build/features/featuresScreens.d.ts +2 -0
- package/build/features/featuresScreens.js +28 -0
- package/build/hooks/index.d.ts +4 -0
- package/build/hooks/index.js +4 -1
- package/build/hooks/useAppDispatch.d.ts +4 -0
- package/build/hooks/useAppDispatch.js +2 -0
- package/build/hooks/useAppSelector.d.ts +3 -0
- package/build/hooks/useAppSelector.js +2 -0
- package/build/hooks/useAppTheme.js +3 -3
- package/build/hooks/useEventListener.d.ts +5 -0
- package/build/hooks/useEventListener.js +20 -0
- package/build/hooks/useLanguage.d.ts +4 -0
- package/build/hooks/useLanguage.js +8 -0
- package/build/hooks/useThemeMode.js +0 -1
- package/build/i18n.js +0 -1
- package/build/index.css +5 -0
- package/build/index.js +0 -1
- package/build/theme/components.js +0 -1
- package/build/theme/index.js +0 -1
- package/build/theme/palette.js +1 -1
- package/build/theme/shadows.js +0 -1
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +0 -2
- package/build/theme/typography.js +0 -1
- package/build/utils/array.js +0 -1
- package/build/utils/html.js +0 -1
- package/build/utils/index.js +0 -1
- package/build/utils/object.js +0 -1
- package/build/utils/storage.js +0 -1
- package/build/utils/string.d.ts +1 -1
- package/build/utils/string.js +1 -4
- package/build/utils/style.js +0 -1
- package/build/utils/validation.d.ts +4 -0
- package/build/utils/validation.js +12 -1
- package/package.json +120 -112
- package/build/@types/app.js.map +0 -1
- package/build/@types/index.js.map +0 -1
- package/build/@types/redux.js.map +0 -1
- package/build/@types/theme.js.map +0 -1
- package/build/app/hooks.d.ts +0 -7
- package/build/app/hooks.js +0 -4
- package/build/app/hooks.js.map +0 -1
- package/build/app/rootReducer.js.map +0 -1
- package/build/app/settings.js.map +0 -1
- package/build/app/store.js.map +0 -1
- package/build/components/AnimationFlow/AnimationFlow.js.map +0 -1
- package/build/components/AnimationFlow/BottomSheet.js.map +0 -1
- package/build/components/AnimationFlow/Dialog.js.map +0 -1
- package/build/components/AnimationFlow/index.js.map +0 -1
- package/build/components/Button/Button.js.map +0 -1
- package/build/components/Button/index.js.map +0 -1
- package/build/components/CheckBox/CheckBox.js.map +0 -1
- package/build/components/CheckBox/index.js.map +0 -1
- package/build/components/DatePicker/DatePicker.js.map +0 -1
- package/build/components/DatePicker/index.js.map +0 -1
- package/build/components/Footer/Footer.js.map +0 -1
- package/build/components/Footer/index.js.map +0 -1
- package/build/components/Form/Form.js.map +0 -1
- package/build/components/Form/index.js.map +0 -1
- package/build/components/Icon/Icon.js.map +0 -1
- package/build/components/Icon/index.js.map +0 -1
- package/build/components/Input/Input.js.map +0 -1
- package/build/components/Input/index.js.map +0 -1
- package/build/components/InputAdornment/InputAdornment.js.map +0 -1
- package/build/components/InputAdornment/index.js.map +0 -1
- package/build/components/List/List.js.map +0 -1
- package/build/components/List/index.js.map +0 -1
- package/build/components/ListItem/ListItem.js.map +0 -1
- package/build/components/ListItem/index.js.map +0 -1
- package/build/components/Loader/Loader.js.map +0 -1
- package/build/components/Loader/index.js.map +0 -1
- package/build/components/LogoBadge/LogoBadge.js.map +0 -1
- package/build/components/LogoBadge/index.js.map +0 -1
- package/build/components/OTPField/OTPField.js.map +0 -1
- package/build/components/OTPField/index.js.map +0 -1
- package/build/components/OTPTimer/OTPTimer.js.map +0 -1
- package/build/components/OTPTimer/index.js.map +0 -1
- package/build/components/ProgressBar/ProgressBar.js.map +0 -1
- package/build/components/ProgressBar/index.js.map +0 -1
- package/build/components/Providers/ReduxProvider.js.map +0 -1
- package/build/components/Providers/ThemeProvider.js.map +0 -1
- package/build/components/Providers/index.js.map +0 -1
- package/build/components/SimpleList/SimpleList.js.map +0 -1
- package/build/components/SimpleList/index.js.map +0 -1
- package/build/components/Text/Text.js.map +0 -1
- package/build/components/Text/index.js.map +0 -1
- package/build/components/Warning/Warning.js.map +0 -1
- package/build/components/Warning/index.js.map +0 -1
- package/build/constants/app.js.map +0 -1
- package/build/constants/assets.js.map +0 -1
- package/build/constants/dummy.js.map +0 -1
- package/build/constants/index.js.map +0 -1
- package/build/features/app/midStore.js.map +0 -1
- package/build/features/connect/Connect.js.map +0 -1
- package/build/features/connect/index.js.map +0 -1
- package/build/features/connect/screens/MID/BusinessCountry.js.map +0 -1
- package/build/features/connect/screens/MID/IDNumber.js.map +0 -1
- package/build/features/connect/screens/MID/MID.js.map +0 -1
- package/build/features/connect/screens/MID/MIDTitle.js.map +0 -1
- package/build/features/connect/screens/MID/MobileNumber.js.map +0 -1
- package/build/features/connect/screens/MID/index.js.map +0 -1
- package/build/features/connect/screens/OTP/OTP.js.map +0 -1
- package/build/features/connect/screens/OTP/index.js.map +0 -1
- package/build/hooks/index.js.map +0 -1
- package/build/hooks/useAppTheme.js.map +0 -1
- package/build/hooks/useThemeMode.js.map +0 -1
- package/build/i18n.js.map +0 -1
- package/build/index.js.map +0 -1
- package/build/theme/components.js.map +0 -1
- package/build/theme/index.js.map +0 -1
- package/build/theme/palette.js.map +0 -1
- package/build/theme/shadows.js.map +0 -1
- package/build/theme/theme.js.map +0 -1
- package/build/theme/typography.js.map +0 -1
- package/build/utils/array.js.map +0 -1
- package/build/utils/html.js.map +0 -1
- package/build/utils/index.js.map +0 -1
- package/build/utils/object.js.map +0 -1
- package/build/utils/storage.js.map +0 -1
- package/build/utils/string.js.map +0 -1
- package/build/utils/style.js.map +0 -1
- package/build/utils/validation.js.map +0 -1
|
@@ -20,12 +20,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
23
24
|
import * as React from 'react';
|
|
24
25
|
import Box from '@mui/material/Box';
|
|
25
26
|
import { useTranslation } from 'react-i18next';
|
|
27
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
26
28
|
import { styled, alpha } from '@mui/material/styles';
|
|
27
29
|
import Text from '../../../../components/Text';
|
|
28
|
-
import Collapse from '
|
|
30
|
+
import Collapse from '../../../../components/Collapse';
|
|
29
31
|
import Tooltip from '@mui/material/Tooltip';
|
|
30
32
|
import CheckIcon from '@mui/icons-material/Check';
|
|
31
33
|
import ClearIcon from '@mui/icons-material/Clear';
|
|
@@ -33,8 +35,9 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
|
33
35
|
import Icon from '../../../../components/Icon';
|
|
34
36
|
import Input from '../../../../components/Input';
|
|
35
37
|
import SimpleList from '../../../../components/SimpleList';
|
|
36
|
-
import { ICONS_NAMES
|
|
38
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
37
39
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
40
|
+
import { useLanguage } from '../../../../hooks';
|
|
38
41
|
var IconStyled = styled(Icon)(function (_a) {
|
|
39
42
|
var theme = _a.theme;
|
|
40
43
|
return ({
|
|
@@ -105,88 +108,44 @@ var CountryCodeStyled = styled(Text)(function (_a) {
|
|
|
105
108
|
return (__assign(__assign({ cursor: 'pointer' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightRegular, display: 'flex', alignItems: 'center', minWidth: theme.spacing(8.75) }));
|
|
106
109
|
});
|
|
107
110
|
var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
108
|
-
var
|
|
109
|
-
var
|
|
110
|
-
var
|
|
111
|
-
var
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}, []);
|
|
118
|
-
React.useEffect(function () {
|
|
119
|
-
if (defaultCountry)
|
|
120
|
-
setSelected(defaultCountry);
|
|
121
|
-
}, [defaultCountry]);
|
|
111
|
+
var _b;
|
|
112
|
+
var countries = _a.countries, rest = __rest(_a, ["countries"]);
|
|
113
|
+
var countriesCode = React.useState(countries)[0];
|
|
114
|
+
var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
|
|
115
|
+
var t = useTranslation().t;
|
|
116
|
+
var isAr = useLanguage().isAr;
|
|
117
|
+
var control = useFormContext().control;
|
|
118
|
+
var phoneControl = useController({ name: 'mobile', control: control });
|
|
119
|
+
var countryCodeControl = useController({ name: 'countryCode', control: control });
|
|
122
120
|
var onPhoneNumberChange = function (_a) {
|
|
123
|
-
var _b;
|
|
124
121
|
var target = _a.target;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
setMobileValue(target.value);
|
|
122
|
+
var value = removeAllCharsFromNumber(target.value);
|
|
123
|
+
phoneControl.field.onChange(value);
|
|
128
124
|
};
|
|
129
125
|
var clearMobileNumber = function () {
|
|
130
|
-
|
|
131
|
-
setMobileValue('');
|
|
132
|
-
(_a = rest.onMobileChange) === null || _a === void 0 ? void 0 : _a.call(rest, '');
|
|
133
|
-
};
|
|
134
|
-
var onCountryCodeSearch = function (e) {
|
|
135
|
-
if (e === null || e === void 0 ? void 0 : e.code) {
|
|
136
|
-
var searchList = getCountryCodeSearch(countriesCode, e.code);
|
|
137
|
-
if (searchList.length === 0 || e.code === 'Backspace')
|
|
138
|
-
setCountriesCode(countriesCode);
|
|
139
|
-
else
|
|
140
|
-
setCountriesCode(searchList);
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
var getCountryCodeSearch = function (originalList, searchKey) {
|
|
144
|
-
var _a;
|
|
145
|
-
return (_a = (originalList || [])) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
|
|
146
|
-
return item.name.english.charAt(0).toLowerCase() === searchKey.charAt(searchKey.length - 1).toLowerCase();
|
|
147
|
-
});
|
|
126
|
+
phoneControl.field.onChange('');
|
|
148
127
|
};
|
|
149
128
|
var onOpenCountryList = function (event) {
|
|
150
129
|
var _a;
|
|
151
130
|
setAnchorEl(event.currentTarget);
|
|
152
|
-
|
|
153
|
-
setCountriesCode(countries);
|
|
154
|
-
(_a = rest.onOpenCountryList) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
131
|
+
(_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
155
132
|
};
|
|
156
133
|
var onCloseCountryList = function () {
|
|
157
134
|
var _a;
|
|
158
135
|
setAnchorEl(null);
|
|
159
|
-
|
|
160
|
-
setCountriesCode(countries);
|
|
161
|
-
(_a = rest.onCloseCountryList) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
136
|
+
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
162
137
|
};
|
|
163
138
|
var onSelectItem = function (country) {
|
|
164
|
-
setSelected(country);
|
|
165
|
-
onSelect && onSelect(country);
|
|
166
139
|
onCloseCountryList();
|
|
140
|
+
countryCodeControl.field.onChange(country);
|
|
167
141
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
React.createElement(ExpandIcon, { anchorEl: anchorEl })), endAdornment: mobileValue && React.createElement(ClearIconStyled, { onClick: clearMobileNumber }), placeholder: "".concat((selected === null || selected === void 0 ? void 0 : selected.iso2) === 'SA' ? '5' : '0', "00000000") }),
|
|
177
|
-
React.createElement(Collapse, { in: !!anchorEl, unmountOnExit: true, timeout: 300 },
|
|
178
|
-
React.createElement(SimpleList, { list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
179
|
-
return (React.createElement(React.Fragment, null,
|
|
180
|
-
React.createElement(CountryItemContainer, null,
|
|
181
|
-
React.createElement(CountryCodeText, { sx: { width: function (_a) {
|
|
182
|
-
var spacing = _a.spacing;
|
|
183
|
-
return spacing(10);
|
|
184
|
-
} }, isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (selected === null || selected === void 0 ? void 0 : selected.idd_prefix) },
|
|
185
|
-
"+",
|
|
186
|
-
item.idd_prefix),
|
|
187
|
-
React.createElement(CountryNameText, { isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (selected === null || selected === void 0 ? void 0 : selected.idd_prefix) }, isAR ? item.name.arabic : item.name.english)),
|
|
188
|
-
item.idd_prefix === (selected === null || selected === void 0 ? void 0 : selected.idd_prefix) && React.createElement(CheckIconStyled, null)));
|
|
189
|
-
} })))));
|
|
142
|
+
var mobileValue = phoneControl.field.value;
|
|
143
|
+
var countryCodeValue = countryCodeControl.field.value;
|
|
144
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(BoxStyled, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('mobile_number_label') }), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(Tooltip, __assign({ title: t('switch_to_id') }, { children: _jsx(IconStyled, { onClick: rest.onSwitchToIdNumber, alt: 'switcher icon', src: ICONS_NAMES.ID_IMAGE }) })) }))] }), _jsx(InputStyled, { dir: 'ltr', inputProps: { maxLength: (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits) || 10 }, onChange: onPhoneNumberChange, value: mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: onOpenCountryList }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), _jsx(ExpandIcon, { anchorEl: anchorEl })] })), endAdornment: mobileValue && _jsx(ClearIconStyled, { onClick: clearMobileNumber }), placeholder: "".concat((countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.iso2) === 'SA' ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: (_b = phoneControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
145
|
+
return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ sx: { width: function (_a) {
|
|
146
|
+
var spacing = _a.spacing;
|
|
147
|
+
return spacing(10);
|
|
148
|
+
} }, isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIconStyled, {})] }));
|
|
149
|
+
} }) }))] })) })));
|
|
190
150
|
});
|
|
191
151
|
export default React.memo(MobileNumber);
|
|
192
|
-
//# sourceMappingURL=MobileNumber.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const NIDValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
5
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
6
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
9
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
}>>>;
|
|
12
|
+
export declare const PhoneValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
|
+
mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
14
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
|
+
mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
16
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
17
|
+
mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
18
|
+
}>>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export var NIDValidationSchema = yup.object().shape({
|
|
3
|
+
dob: yup.string().min(5).required('DOB is required'),
|
|
4
|
+
nid: yup.string().min(8).max(10).required('NID is required')
|
|
5
|
+
});
|
|
6
|
+
export var PhoneValidationSchema = yup.object().shape({
|
|
7
|
+
mobile: yup.string().min(5).required('Phone number is required')
|
|
8
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
18
|
+
import InfoIcon from '@mui/icons-material/Info';
|
|
19
|
+
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
20
|
+
import Text from '../../../../components/Text';
|
|
21
|
+
import Input from '../../../../components/Input';
|
|
22
|
+
import ClearIcon from '@mui/icons-material/Clear';
|
|
23
|
+
import Tooltip from '../../../../components/Tooltip';
|
|
24
|
+
import { removeAllOtherThanAlphabet } from '../../../../utils';
|
|
25
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
26
|
+
var theme = _a.theme;
|
|
27
|
+
return ({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
padding: theme.spacing(0, 0, 3, 0),
|
|
31
|
+
direction: theme.direction
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
35
|
+
var theme = _a.theme;
|
|
36
|
+
return ({
|
|
37
|
+
display: 'flex',
|
|
38
|
+
justifyContent: 'space-between',
|
|
39
|
+
padding: theme.spacing(0, 2.5, 1, 2.5)
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
43
|
+
var theme = _a.theme;
|
|
44
|
+
return ({
|
|
45
|
+
color: alpha(theme.palette.text.primary, 0.4),
|
|
46
|
+
fontSize: theme.spacing(1.5)
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
50
|
+
var theme = _a.theme;
|
|
51
|
+
return ({
|
|
52
|
+
padding: theme.spacing(0, 2, 0, 0)
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
var ClearIconStyled = styled(ClearIcon)(function (_a) {
|
|
56
|
+
var theme = _a.theme;
|
|
57
|
+
return ({
|
|
58
|
+
width: theme.spacing(2),
|
|
59
|
+
height: theme.spacing(2),
|
|
60
|
+
cursor: 'pointer',
|
|
61
|
+
color: alpha(theme.palette.text.primary, 0.4)
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
|
|
65
|
+
var theme = _a.theme;
|
|
66
|
+
return ({
|
|
67
|
+
width: theme.spacing(2.75),
|
|
68
|
+
height: theme.spacing(2.125),
|
|
69
|
+
cursor: 'pointer',
|
|
70
|
+
color: alpha(theme.palette.text.primary, 0.4)
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
var InfoIconStyled = styled(InfoIcon)(function (_a) {
|
|
74
|
+
var theme = _a.theme;
|
|
75
|
+
return ({
|
|
76
|
+
width: theme.spacing(2.75),
|
|
77
|
+
height: theme.spacing(2.125),
|
|
78
|
+
cursor: 'pointer',
|
|
79
|
+
color: alpha(theme.palette.text.primary, 0.4)
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
var BrandName = function (_a) {
|
|
83
|
+
var _b;
|
|
84
|
+
var _c = React.useState(false), isHovered = _c[0], setIsHovered = _c[1];
|
|
85
|
+
var t = useTranslation().t;
|
|
86
|
+
var control = useFormContext().control;
|
|
87
|
+
var brandControl = useController({ control: control, name: 'brandName' });
|
|
88
|
+
var handleBrandNameChange = function (_a) {
|
|
89
|
+
var target = _a.target;
|
|
90
|
+
var value = removeAllOtherThanAlphabet(target.value);
|
|
91
|
+
brandControl.field.onChange(value);
|
|
92
|
+
};
|
|
93
|
+
var clearBrandName = function () {
|
|
94
|
+
brandControl.field.onChange('');
|
|
95
|
+
};
|
|
96
|
+
var brandNameValue = brandControl.field.value;
|
|
97
|
+
return (_jsxs(BoxStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('brand_name_label') }), _jsx(Tooltip, __assign({ title: t('brand_name_description'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(InputStyled, { onChange: handleBrandNameChange, value: brandNameValue, endAdornment: brandNameValue && _jsx(ClearIconStyled, { onClick: clearBrandName }), placeholder: t('brand_name_placeholder'), warningType: 'alert', warningMessage: (_b = brandControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message })] }));
|
|
98
|
+
};
|
|
99
|
+
export default React.memo(BrandName);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
17
|
+
import Box from '@mui/material/Box';
|
|
18
|
+
import { styled } from '@mui/material/styles';
|
|
19
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
20
|
+
import { handleNextScreenStep, settingsSelector } from '../../../../app/settings';
|
|
21
|
+
import Form from '../../../../components/Form';
|
|
22
|
+
import Loader from '../../../../components/Loader';
|
|
23
|
+
import Icon from '../../../../components/Icon';
|
|
24
|
+
import Button from '../../../../components/Button';
|
|
25
|
+
import { useLanguage } from '../../../../hooks';
|
|
26
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
27
|
+
import { MerchantValidationSchema } from './validation';
|
|
28
|
+
import BrandName from './BrandName';
|
|
29
|
+
import SocialMedia from './SocialMedia';
|
|
30
|
+
import TAC from './TAC';
|
|
31
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
32
|
+
var theme = _a.theme;
|
|
33
|
+
return ({
|
|
34
|
+
padding: theme.spacing(2.5, 0, 2.5, 0),
|
|
35
|
+
overflow: 'hidden',
|
|
36
|
+
direction: theme.direction
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var ButtonContainer = styled(Box)(function (_a) {
|
|
40
|
+
var theme = _a.theme;
|
|
41
|
+
return ({
|
|
42
|
+
margin: theme.spacing(0, 2.5, 0, 2.5)
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
var InputsContainerStyled = styled(Box)(function (_a) {
|
|
46
|
+
var theme = _a.theme;
|
|
47
|
+
return ({
|
|
48
|
+
paddingBottom: theme.spacing(5)
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
|
52
|
+
var theme = _a.theme, isAr = _a.isAr;
|
|
53
|
+
return ({
|
|
54
|
+
width: theme.spacing(3),
|
|
55
|
+
height: theme.spacing(3),
|
|
56
|
+
paddingInlineStart: theme.spacing(1.5),
|
|
57
|
+
paddingInlineEnd: theme.spacing(0.5),
|
|
58
|
+
transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var LoaderStyled = styled(Loader)(function (_a) {
|
|
62
|
+
var theme = _a.theme;
|
|
63
|
+
return ({
|
|
64
|
+
marginInlineStart: theme.spacing(-6.25),
|
|
65
|
+
'& .loader-box-container': {
|
|
66
|
+
marginInlineStart: theme.spacing(2.5)
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
var Merchant = function (_a) {
|
|
71
|
+
var methods = useForm({
|
|
72
|
+
resolver: yupResolver(MerchantValidationSchema),
|
|
73
|
+
defaultValues: {
|
|
74
|
+
brandName: '',
|
|
75
|
+
termAndConditionChecked: false,
|
|
76
|
+
links: {
|
|
77
|
+
website: '',
|
|
78
|
+
twitter: '',
|
|
79
|
+
instagram: ''
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
mode: 'onChange'
|
|
83
|
+
});
|
|
84
|
+
var t = useTranslation().t;
|
|
85
|
+
var isAr = useLanguage().isAr;
|
|
86
|
+
var dispatch = useAppDispatch();
|
|
87
|
+
var settingStore = useAppSelector(settingsSelector);
|
|
88
|
+
var onSubmit = function (data) {
|
|
89
|
+
console.log('data', data);
|
|
90
|
+
dispatch(handleNextScreenStep(settingStore.data.activeScreen));
|
|
91
|
+
};
|
|
92
|
+
return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, { children: [_jsx(BrandName, {}), _jsx(SocialMedia, {}), _jsx(TAC, {})] }), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30, toggleAnimation: false }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
|
|
93
|
+
};
|
|
94
|
+
export default React.memo(Merchant);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
18
|
+
import ClearIcon from '@mui/icons-material/Clear';
|
|
19
|
+
import { SocialMediaTypes } from '../../../../@types';
|
|
20
|
+
import Input from '../../../../components/Input';
|
|
21
|
+
import Text from '../../../../components/Text';
|
|
22
|
+
import Collapse from '../../../../components/Collapse';
|
|
23
|
+
import SocialMediaGroup from '../../../../components/SocialMediaGroup';
|
|
24
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
25
|
+
var theme = _a.theme;
|
|
26
|
+
return ({
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
direction: theme.direction
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
var SocialMediaGroupStyled = styled(SocialMediaGroup)(function (_a) {
|
|
33
|
+
var theme = _a.theme, defaultValue = _a.defaultValue;
|
|
34
|
+
return ({
|
|
35
|
+
borderTop: "1px solid ".concat(alpha(theme.palette.divider, 0.8)),
|
|
36
|
+
borderBottom: !defaultValue ? "1px solid ".concat(alpha(theme.palette.divider, 0.8)) : ''
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
40
|
+
var theme = _a.theme;
|
|
41
|
+
return ({
|
|
42
|
+
padding: theme.spacing(0, 2, 0, 0),
|
|
43
|
+
input: {
|
|
44
|
+
paddingInlineStart: theme.spacing(0)
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
var TextStyled = styled(Text)(function (_a) {
|
|
49
|
+
var theme = _a.theme;
|
|
50
|
+
return ({
|
|
51
|
+
padding: theme.spacing(0, 0, 0, 1.5)
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
var ClearIconStyled = styled(ClearIcon)(function (_a) {
|
|
55
|
+
var theme = _a.theme;
|
|
56
|
+
return ({
|
|
57
|
+
width: theme.spacing(2),
|
|
58
|
+
height: theme.spacing(2),
|
|
59
|
+
cursor: 'pointer',
|
|
60
|
+
color: alpha(theme.palette.text.primary, 0.4)
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
var SocialMedia = function (_a) {
|
|
64
|
+
var _b, _c, _d;
|
|
65
|
+
var _e = React.useState(SocialMediaTypes.WEB), socialMediaType = _e[0], setSocialMediaType = _e[1];
|
|
66
|
+
var t = useTranslation().t;
|
|
67
|
+
var control = useFormContext().control;
|
|
68
|
+
var linksControl = useController({ control: control, name: 'links' });
|
|
69
|
+
var links = linksControl.field.value;
|
|
70
|
+
var handleChange = function (_a) {
|
|
71
|
+
var _b;
|
|
72
|
+
var target = _a.target;
|
|
73
|
+
linksControl.field.onChange(__assign(__assign({}, links), (_b = {}, _b[socialMediaType] = target.value, _b)));
|
|
74
|
+
};
|
|
75
|
+
var handleClear = function () {
|
|
76
|
+
var _a;
|
|
77
|
+
linksControl.field.onChange(__assign(__assign({}, links), (_a = {}, _a[socialMediaType] = '', _a)));
|
|
78
|
+
};
|
|
79
|
+
var websiteValue = links.website || '';
|
|
80
|
+
var twitterValue = links.twitter || '';
|
|
81
|
+
var instagramValue = links.instagram || '';
|
|
82
|
+
var errors = linksControl.fieldState.error;
|
|
83
|
+
return (_jsxs(BoxStyled, { children: [_jsx(SocialMediaGroupStyled, { defaultValue: socialMediaType, exclusive: true, onChange: function (e, value) {
|
|
84
|
+
setSocialMediaType(value);
|
|
85
|
+
} }), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.WEB, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: websiteValue, startAdornment: _jsx(TextStyled, { children: "https://" }), endAdornment: websiteValue && _jsx(ClearIconStyled, { onClick: handleClear }), placeholder: t('website_placeholder'), warningType: 'alert', warningMessage: (_b = errors === null || errors === void 0 ? void 0 : errors.website) === null || _b === void 0 ? void 0 : _b.message }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.TWITTER, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: twitterValue, startAdornment: _jsx(TextStyled, { children: "@" }), endAdornment: twitterValue && _jsx(ClearIconStyled, { onClick: handleClear }), placeholder: t('twitter_placeholder'), warningType: 'alert', warningMessage: (_c = errors === null || errors === void 0 ? void 0 : errors.twitter) === null || _c === void 0 ? void 0 : _c.message }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.INSTAGRAM, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: instagramValue, startAdornment: _jsx(TextStyled, { children: "@" }), endAdornment: instagramValue && _jsx(ClearIconStyled, { onClick: handleClear }), placeholder: t('instagram_placeholder'), warningType: 'alert', warningMessage: (_d = errors === null || errors === void 0 ? void 0 : errors.instagram) === null || _d === void 0 ? void 0 : _d.message }) }))] }));
|
|
86
|
+
};
|
|
87
|
+
export default React.memo(SocialMedia);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
18
|
+
import Link from '@mui/material/Link';
|
|
19
|
+
import CheckBox from '../../../../components/CheckBox';
|
|
20
|
+
import Text from '../../../../components/Text';
|
|
21
|
+
import Warning from '../../../../components/Warning';
|
|
22
|
+
import { useLanguage } from '../../../../hooks';
|
|
23
|
+
import Collapse from '../../../../components/Collapse';
|
|
24
|
+
import { EXTERNAL_LINKS } from '../../../../constants';
|
|
25
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
26
|
+
var theme = _a.theme;
|
|
27
|
+
return ({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
padding: theme.spacing(3, 0, 0, 0),
|
|
31
|
+
alignItems: 'start',
|
|
32
|
+
width: '100%'
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
var TACContainerStyled = styled(Box)(function (_a) {
|
|
36
|
+
var theme = _a.theme;
|
|
37
|
+
return ({
|
|
38
|
+
display: 'flex',
|
|
39
|
+
flexDirection: 'row',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
padding: theme.spacing(0, 2.5, 1.5, 2.5)
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
var TextStyled = styled(Text)(function (_a) {
|
|
45
|
+
var theme = _a.theme;
|
|
46
|
+
return (__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre' }, theme.typography.body2));
|
|
47
|
+
});
|
|
48
|
+
var LinkStyled = styled(Link)(function (_a) {
|
|
49
|
+
var theme = _a.theme;
|
|
50
|
+
return ({
|
|
51
|
+
color: theme.palette.primary.main,
|
|
52
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
53
|
+
letterSpacing: theme.spacing(0)
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
var CheckboxStyled = styled(CheckBox)(function (_a) {
|
|
57
|
+
var theme = _a.theme;
|
|
58
|
+
return ({
|
|
59
|
+
margin: theme.spacing(0),
|
|
60
|
+
padding: theme.spacing(0),
|
|
61
|
+
marginInlineEnd: theme.spacing(1.5),
|
|
62
|
+
color: theme.palette.primary.main,
|
|
63
|
+
'& .MuiSvgIcon-root': {
|
|
64
|
+
fontSize: 30
|
|
65
|
+
},
|
|
66
|
+
'&.Mui-checked': {
|
|
67
|
+
color: theme.palette.text.primary,
|
|
68
|
+
borderRadius: theme.spacing(2.5)
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var CollapseStyled = styled(Collapse)(function () { return ({
|
|
73
|
+
width: '100%'
|
|
74
|
+
}); });
|
|
75
|
+
var TAC = function (_a) {
|
|
76
|
+
var _b;
|
|
77
|
+
var t = useTranslation().t;
|
|
78
|
+
var isAr = useLanguage().isAr;
|
|
79
|
+
var control = useFormContext().control;
|
|
80
|
+
var tacControl = useController({ control: control, name: 'termAndConditionChecked' });
|
|
81
|
+
var tacChecked = tacControl.field.value;
|
|
82
|
+
var warningMessage = (_b = tacControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
83
|
+
var handleTACCheckedChange = function (event, checked) {
|
|
84
|
+
tacControl.field.onChange(checked);
|
|
85
|
+
};
|
|
86
|
+
return (_jsxs(BoxStyled, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TOS_AR : EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage })) }))] }));
|
|
87
|
+
};
|
|
88
|
+
export default React.memo(TAC);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const MerchantValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
5
|
+
links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
6
|
+
website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
8
|
+
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
9
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
|
+
website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
12
|
+
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
13
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
14
|
+
website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
15
|
+
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
16
|
+
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
17
|
+
}>>>;
|
|
18
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
19
|
+
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
20
|
+
termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
21
|
+
links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
22
|
+
website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
23
|
+
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
24
|
+
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
25
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
26
|
+
website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
27
|
+
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
28
|
+
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
29
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
30
|
+
website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
31
|
+
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
32
|
+
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
33
|
+
}>>>;
|
|
34
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
35
|
+
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
36
|
+
termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
37
|
+
links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
38
|
+
website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
39
|
+
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
40
|
+
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
41
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
42
|
+
website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
43
|
+
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
44
|
+
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
45
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
46
|
+
website: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
47
|
+
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
48
|
+
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
49
|
+
}>>>;
|
|
50
|
+
}>>>;
|