@tap-payments/os-micro-frontend-shared 0.1.123-test.6 → 0.1.123-test.8

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.
@@ -15,6 +15,7 @@ import { ImageWrapper } from '../../../index.js';
15
15
  import { TableCell } from '../../../TableCells';
16
16
  import { openUrl } from '../../../../utils/index.js';
17
17
  import { ChannelTextLabel, ChannelTextWrapper, salesChannelAnimation, SalesChannelsContainer, StyledSourceCell, StyledSourceImage } from './style';
18
+ import { NON_CLICKABLE_CHANNELS } from './constants';
18
19
  function SalesChannelCell(_a) {
19
20
  var _b;
20
21
  var { channels, isTextShown } = _a, props = __rest(_a, ["channels", "isTextShown"]);
@@ -23,9 +24,11 @@ function SalesChannelCell(_a) {
23
24
  const sourceTooltip = channel.address;
24
25
  const channelCode = (_a = channel.code) === null || _a === void 0 ? void 0 : _a.replace(/_/g, '');
25
26
  const isLastChannel = index === (channels === null || channels === void 0 ? void 0 : channels.length) - 1;
26
- return (_jsx(Tooltip, Object.assign({ title: sourceTooltip }, { children: _jsx(ImageWrapper, Object.assign({ order: index, variants: salesChannelAnimation(index, isTextShown ? 74 : 0), sx: Object.assign({ width: isTextShown ? '70px' : '36px', cursor: 'pointer' }, (isLastChannel && {
27
+ return (_jsx(Tooltip, Object.assign({ title: sourceTooltip }, { children: _jsx(ImageWrapper, Object.assign({ order: index, variants: salesChannelAnimation(index, isTextShown ? 74 : 0), sx: Object.assign({ width: isTextShown ? '70px' : '36px', cursor: NON_CLICKABLE_CHANNELS.includes(channel.code) ? 'default' : 'pointer' }, (isLastChannel && {
27
28
  boxShadow: '7px 0px 8px 0px #F2F2F2',
28
29
  })), onClick: () => {
30
+ if (NON_CLICKABLE_CHANNELS.includes(channel.code))
31
+ return;
29
32
  if (channel === null || channel === void 0 ? void 0 : channel.address)
30
33
  openUrl(channel.address);
31
34
  } }, { children: isTextShown ? (_jsx(ChannelTextWrapper, { children: _jsx(ChannelTextLabel, { children: channelCode }) })) : (_jsx(StyledSourceImage, { src: channel.logo, alt: channelCode })) })) }), `${channel}-${index}`));
@@ -0,0 +1,2 @@
1
+ import { SalesChannelTypes } from '../../../../types/index.js';
2
+ export declare const NON_CLICKABLE_CHANNELS: SalesChannelTypes[];
@@ -0,0 +1,2 @@
1
+ import { SalesChannelTypes } from '../../../../types/index.js';
2
+ export const NON_CLICKABLE_CHANNELS = [SalesChannelTypes.CALL_CENTER, SalesChannelTypes.PHYSICAL_STORE, SalesChannelTypes.IOS];
@@ -12,7 +12,7 @@ export const openUrl = (url) => {
12
12
  window.open(url, '_blank', 'noopener,noreferrer');
13
13
  }
14
14
  else {
15
- const newUrl = 'about:blank?' + encodeURIComponent(url);
15
+ const newUrl = encodeURIComponent(url);
16
16
  window.open(newUrl, '_blank', 'noopener,noreferrer');
17
17
  }
18
18
  };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.123-test.6",
5
- "testVersion": 6,
4
+ "version": "0.1.123-test.8",
5
+ "testVersion": 8,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",