@tap-payments/auth-jsconnect 2.11.20-development → 2.11.21-development

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.
@@ -12,7 +12,8 @@ export interface DeviceCardProps extends CardProps {
12
12
  loading?: boolean;
13
13
  arrow?: boolean;
14
14
  endAdornment?: React.ReactNode;
15
+ titleSx?: React.CSSProperties;
15
16
  }
16
- export declare const DeviceCard: ({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, ...rest }: DeviceCardProps) => JSX.Element;
17
- declare const _default: React.MemoExoticComponent<({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, ...rest }: DeviceCardProps) => JSX.Element>;
17
+ export declare const DeviceCard: ({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, titleSx, ...rest }: DeviceCardProps) => JSX.Element;
18
+ declare const _default: React.MemoExoticComponent<({ image, name, deviceId, deviceIdLabel, isLinked, pairedWith, onClick, badge, border, arrow, loading, endAdornment, titleSx, ...rest }: DeviceCardProps) => JSX.Element>;
18
19
  export default _default;
@@ -86,7 +86,7 @@ var ArrowIcon = styled(ArrowForwardIosIcon)(function (_a) {
86
86
  })));
87
87
  });
88
88
  export var DeviceCard = function (_a) {
89
- var image = _a.image, name = _a.name, deviceId = _a.deviceId, deviceIdLabel = _a.deviceIdLabel, isLinked = _a.isLinked, pairedWith = _a.pairedWith, onClick = _a.onClick, badge = _a.badge, border = _a.border, arrow = _a.arrow, loading = _a.loading, endAdornment = _a.endAdornment, rest = __rest(_a, ["image", "name", "deviceId", "deviceIdLabel", "isLinked", "pairedWith", "onClick", "badge", "border", "arrow", "loading", "endAdornment"]);
89
+ var image = _a.image, name = _a.name, deviceId = _a.deviceId, deviceIdLabel = _a.deviceIdLabel, isLinked = _a.isLinked, pairedWith = _a.pairedWith, onClick = _a.onClick, badge = _a.badge, border = _a.border, arrow = _a.arrow, loading = _a.loading, endAdornment = _a.endAdornment, titleSx = _a.titleSx, rest = __rest(_a, ["image", "name", "deviceId", "deviceIdLabel", "isLinked", "pairedWith", "onClick", "badge", "border", "arrow", "loading", "endAdornment", "titleSx"]);
90
90
  var t = useTranslation().t;
91
91
  var _b = useTheme(), typography = _b.typography, palette = _b.palette;
92
92
  var getEndComponent = function () {
@@ -97,6 +97,6 @@ export var DeviceCard = function (_a) {
97
97
  if (arrow)
98
98
  return _jsx(ArrowIcon, {});
99
99
  };
100
- return (_jsxs(DeviceCardContainer, __assign({ onClick: onClick, sx: { cursor: onClick ? 'pointer' : 'default' }, showBorder: border }, rest, { children: [_jsxs(DeviceDetails, { children: [image && _jsx(DeviceImage, { src: image, alt: 'Device' }), _jsxs(DeviceInfo, { children: [_jsx(TruncatedTooltipText, { text: name, style: __assign(__assign({}, typography.subtitle1), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }) }), _jsxs(DeviceIdInfo, { children: [pairedWith && (_jsxs("span", { children: [t('terminal_paired_with'), ": ", _jsx(DeviceIdBold, { children: pairedWith })] })), _jsxs("span", { children: [t(deviceIdLabel !== null && deviceIdLabel !== void 0 ? deviceIdLabel : 'terminal_device_id'), ": ", _jsx(DeviceIdBold, { children: deviceId })] })] })] })] }), badge && _jsx(Badge, __assign({ active: isLinked }, { children: isLinked ? t('terminal_linked') : t('terminal_unlinked') })), _jsx(Box, __assign({ display: 'flex', alignItems: 'center' }, { children: getEndComponent() }))] })));
100
+ return (_jsxs(DeviceCardContainer, __assign({ onClick: onClick, sx: { cursor: onClick ? 'pointer' : 'default' }, showBorder: border }, rest, { children: [_jsxs(DeviceDetails, { children: [image && _jsx(DeviceImage, { src: image, alt: 'Device' }), _jsxs(DeviceInfo, { children: [_jsx(TruncatedTooltipText, { text: name, style: __assign(__assign(__assign({}, typography.subtitle1), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }), titleSx) }), _jsxs(DeviceIdInfo, { children: [pairedWith && (_jsxs("span", { children: [t('terminal_paired_with'), ": ", _jsx(DeviceIdBold, { children: pairedWith })] })), _jsxs("span", { children: [t(deviceIdLabel !== null && deviceIdLabel !== void 0 ? deviceIdLabel : 'terminal_device_id'), ": ", _jsx(DeviceIdBold, { children: deviceId })] })] })] })] }), badge && _jsx(Badge, __assign({ active: isLinked }, { children: isLinked ? t('terminal_linked') : t('terminal_unlinked') })), _jsx(Box, __assign({ display: 'flex', alignItems: 'center' }, { children: getEndComponent() }))] })));
101
101
  };
102
102
  export default memo(DeviceCard);
@@ -59,7 +59,7 @@ var NoTerminalDeviceLinked = function () {
59
59
  var t = useTranslation().t;
60
60
  var isAr = useLanguage().isAr;
61
61
  var dispatch = useAppDispatch();
62
- var _a = useAppSelector(terminalSelector), posDevicesLoading = _a.posDevicesLoading, data = _a.data;
62
+ var _a = useAppSelector(terminalSelector), posDevicesLoading = _a.posDevicesLoading, data = _a.data, loading = _a.loading, error = _a.error;
63
63
  var _b = data.responseData || {}, boardFlows = _b.boardFlows, authData = _b.authData, boardData = _b.boardData;
64
64
  var handleOnClickNewTerminalLink = function () { return __awaiter(void 0, void 0, void 0, function () {
65
65
  var err_1;
@@ -98,6 +98,6 @@ var NoTerminalDeviceLinked = function () {
98
98
  })
99
99
  .catch(function () { });
100
100
  };
101
- return (_jsxs(ScreenContainer, __assign({ sx: { ml: 2.5, mr: 2.5 }, minHeight: 280, justifyContent: 'space-between' }, { children: [_jsxs(NoTerminalDeviceLinkedContainer, { children: [_jsx(DeviceImage, { src: ICONS_NAMES.terminal_device }), _jsx(TitleTypography, { children: t('terminal_no_terminal_linked') }), _jsx(DescriptionTypography, { children: t('terminal_no_terminal_linked_description') })] }), _jsx(Button, __assign({ sx: { mt: 0, ml: 0, mr: 0 }, loading: posDevicesLoading, onBackClicked: handleOnBack, onClick: handleOnClickNewTerminalLink, isAr: isAr }, { children: t('terminal_link_terminal') }))] })));
101
+ return (_jsxs(ScreenContainer, __assign({ sx: { ml: 2.5, mr: 2.5 }, minHeight: 280, justifyContent: 'space-between' }, { children: [_jsxs(NoTerminalDeviceLinkedContainer, { children: [_jsx(DeviceImage, { src: ICONS_NAMES.terminal_device }), _jsx(TitleTypography, { children: t('terminal_no_terminal_linked') }), _jsx(DescriptionTypography, { children: t('terminal_no_terminal_linked_description') })] }), _jsx(Button, __assign({ error: error !== null && error !== void 0 ? error : '', sx: { mt: 0, ml: 0, mr: 0 }, loading: posDevicesLoading || loading, onBackClicked: handleOnBack, onClick: handleOnClickNewTerminalLink, isAr: isAr }, { children: t('terminal_link_terminal') }))] })));
102
102
  };
103
103
  export default React.memo(NoTerminalDeviceLinked);
@@ -7,10 +7,12 @@ import Loader from '../../../../components/Loader';
7
7
  import { ListContainer, POSListContainer, TitleContainer, Image, Title, ScrollContainer, ListItem, StyledRadio, ArrowIcon } from './styles';
8
8
  import { useAppSelector } from '../../../../hooks';
9
9
  import { terminalSelector } from '../../../../features/app/terminal/terminalStore';
10
+ import { useTheme } from '@mui/material/styles';
10
11
  var POSDeviceList = function (_a) {
11
12
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12
13
  var posDevices = _a.posDevices, onClick = _a.onClick, selectedPOS = _a.selectedPOS, _m = _a.select, select = _m === void 0 ? true : _m, loading = _a.loading;
13
14
  var t = useTranslation().t;
15
+ var typography = useTheme().typography;
14
16
  var responseData = useAppSelector(terminalSelector).data.responseData;
15
17
  var terminalData = (responseData || {}).terminalData;
16
18
  var platformImage = ((_e = (_d = (_c = (_b = terminalData === null || terminalData === void 0 ? void 0 : terminalData.list) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.platform) === null || _d === void 0 ? void 0 : _d.brand) === null || _e === void 0 ? void 0 : _e.logo) || ICONS_NAMES.platform_image;
@@ -23,6 +25,6 @@ var POSDeviceList = function (_a) {
23
25
  if (!select)
24
26
  return _jsx(ArrowIcon, {});
25
27
  };
26
- return (_jsxs(ListContainer, { children: [_jsxs(TitleContainer, { children: [_jsx(Image, { src: platformImage, alt: 'Device' }), _jsx(Title, { children: t('terminal_devices', { name: platformName }) })] }), _jsx(ScrollContainer, { children: _jsx(POSListContainer, { children: (posDevices || []).map(function (device, index) { return (_jsx(ListItem, { sx: { minHeight: 'unset' }, onClick: function () { return onClick(device); }, name: device.display_name, deviceId: device.reference, deviceIdLabel: 'terminal_device_id', endAdornment: getEndComponent(device) }, index)); }) }) })] }));
28
+ return (_jsxs(ListContainer, { children: [_jsxs(TitleContainer, { children: [_jsx(Image, { src: platformImage, alt: 'Device' }), _jsx(Title, { children: t('terminal_devices', { name: platformName }) })] }), _jsx(ScrollContainer, { children: _jsx(POSListContainer, { children: (posDevices || []).map(function (device, index) { return (_jsx(ListItem, { sx: { minHeight: 'unset' }, titleSx: { fontSize: typography.subtitle2.fontSize }, onClick: function () { return onClick(device); }, name: device.display_name, deviceId: device.reference, deviceIdLabel: 'terminal_device_id', endAdornment: getEndComponent(device) }, index)); }) }) })] }));
27
29
  };
28
30
  export default memo(POSDeviceList);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.11.20-development",
3
+ "version": "2.11.21-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",