@tap-payments/auth-jsconnect 2.3.61-test → 2.3.62-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.
@@ -32,6 +32,7 @@ export interface City {
32
32
  name: {
33
33
  id: string;
34
34
  en: string;
35
+ ar: string;
35
36
  };
36
37
  state: string;
37
38
  un_locode: string;
@@ -981,7 +981,8 @@ export var individualSlice = createSlice({
981
981
  }
982
982
  if (birth === null || birth === void 0 ? void 0 : birth.city) {
983
983
  var selectedCity = cityList === null || cityList === void 0 ? void 0 : cityList.find(function (city) {
984
- return city.name.en === (birth === null || birth === void 0 ? void 0 : birth.city);
984
+ var _a;
985
+ return city.id === ((_a = birth === null || birth === void 0 ? void 0 : birth.city) === null || _a === void 0 ? void 0 : _a.cityId);
985
986
  });
986
987
  state.data.individualPersonalData.placeOfBirthCity = selectedCity;
987
988
  }
@@ -26,7 +26,7 @@ import { useController, useFormContext } from 'react-hook-form';
26
26
  import { styled } from '@mui/material/styles';
27
27
  import CheckIcon from '@mui/icons-material/Check';
28
28
  import CircularProgress from '@mui/material/CircularProgress';
29
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
29
+ import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
30
30
  import Collapse from '../../../../components/Collapse';
31
31
  import ExpandIcon from '../../../../components/ExpandIcon';
32
32
  import Text from '../../../../components/Text';
@@ -64,6 +64,7 @@ var BirthCity = React.forwardRef(function (_a, ref) {
64
64
  var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
65
65
  var t = useTranslation().t;
66
66
  var dispatch = useAppDispatch();
67
+ var isAr = useLanguage().isAr;
67
68
  var _e = useFormContext(), control = _e.control, getValues = _e.getValues, setValue = _e.setValue;
68
69
  var _f = useAppSelector(individualSelector), data = _f.data, cityLoading = _f.cityLoading;
69
70
  var _g = data.verify.responseBody || {}, cityList = _g.cityList, user = _g.user;
@@ -72,11 +73,10 @@ var BirthCity = React.forwardRef(function (_a, ref) {
72
73
  var cityValue = placeOfBirthCityControl.field.value;
73
74
  var error = (_b = placeOfBirthCityControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
74
75
  React.useEffect(function () {
75
- var _a;
76
76
  if ((cityList === null || cityList === void 0 ? void 0 : cityList.length) > 0) {
77
- var city_1 = (_a = cityValue === null || cityValue === void 0 ? void 0 : cityValue.name) === null || _a === void 0 ? void 0 : _a.en;
77
+ var cityId_1 = cityValue === null || cityValue === void 0 ? void 0 : cityValue.id;
78
78
  var selectedCity = cityList.find(function (c) {
79
- return c.name.en.toLowerCase() === (city_1 === null || city_1 === void 0 ? void 0 : city_1.toLowerCase());
79
+ return c.id === cityId_1;
80
80
  }) || {};
81
81
  setValue('placeOfBirthCity', selectedCity, { shouldValidate: true });
82
82
  var list = __spreadArray([], cityList, true);
@@ -109,8 +109,8 @@ var BirthCity = React.forwardRef(function (_a, ref) {
109
109
  placeOfBirthCityControl.field.onChange(city);
110
110
  };
111
111
  var getName = function (city) {
112
- var _a;
113
- return (_a = city === null || city === void 0 ? void 0 : city.name) === null || _a === void 0 ? void 0 : _a.en;
112
+ var _a, _b;
113
+ return isAr ? (_a = city === null || city === void 0 ? void 0 : city.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = city === null || city === void 0 ? void 0 : city.name) === null || _b === void 0 ? void 0 : _b.en;
114
114
  };
115
115
  return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(InputStyled, { label: t('place_birth_city_label'), readOnly: readOnly, placeholder: t('choose_place_birth_city'), value: getName(cityValue) || '', warningMessage: error && t(error), onClick: cityLoading ? undefined : !!anchorEl ? function () { return onCloseCitySelect(); } : onOpenCitySelect, endAdornment: cityLoading ? _jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } }) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.en'], list: locationCities, onSelectItem: onSelectItem, renderItem: function (item) {
116
116
  return (_jsxs(_Fragment, { children: [_jsx(CountryItemContainer, { children: _jsx(CountryNameText, __assign({ isSelected: item.id === (cityValue === null || cityValue === void 0 ? void 0 : cityValue.id) }, { children: getName(item) })) }), item.id === (cityValue === null || cityValue === void 0 ? void 0 : cityValue.id) && _jsx(CheckIconStyled, {})] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.3.61-test",
3
+ "version": "2.3.62-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",