@tap-payments/os-micro-frontend-shared 0.1.147-test.1 → 0.1.147-test.3

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.
@@ -25,15 +25,19 @@ function SegmentsCell(_a) {
25
25
  const [isTooltipOpen, setIsTooltipOpen] = useState(false);
26
26
  const theme = useTheme();
27
27
  const ReferenceSources = useMemo(() => segments === null || segments === void 0 ? void 0 : segments.filter((segment) => !!segment.name).map((segment, index) => {
28
+ var _a, _b;
29
+ const isPlatformSegment = (_b = (_a = segment.type) === null || _a === void 0 ? void 0 : _a.toLowerCase) === null || _b === void 0 ? void 0 : _b.call(_a).includes('platform');
28
30
  const sourceTooltip = segment.tooltip || getSegmentTooltip(segment);
31
+ const segmentType = segment.type;
32
+ const icon = isPlatformSegment ? segmentsIcons.platform : segmentsIcons[segmentType];
29
33
  return (_jsx(Tooltip, Object.assign({ onOpen: () => {
30
34
  setIsTooltipOpen(true);
31
35
  }, onClose: () => {
32
36
  setIsTooltipOpen(false);
33
37
  }, title: sourceTooltip }, { children: _jsx(ImageWrapper, Object.assign({ order: index, variants: referenceSourceAnimation(index, theme.shadows[4], isTextShown ? 83 : 0), sx: {
34
38
  width: isTextShown ? '79px' : '36px',
35
- } }, { children: isTextShown ? (_jsx(ReferenceTextWrapper, { children: _jsx(ReferenceTextLabel, { children: startCase(segment.name) }) })) : (_jsx(IconWithBadge, { mainIcon: segment.icon || segmentsIcons[segment.type], mainIconSize: 16, containerSize: 16, sx: Object.assign({}, (segment.icon ? { borderRadius: '40px' } : { borderRadius: '0px' })), onError: (e) => {
36
- e.currentTarget.src = segmentsIcons[segment.type];
39
+ } }, { children: isTextShown ? (_jsx(ReferenceTextWrapper, { children: _jsx(ReferenceTextLabel, { children: startCase(segment.name) }) })) : (_jsx(IconWithBadge, { mainIcon: segment.icon || icon, mainIconSize: 16, containerSize: 16, sx: Object.assign({}, (segment.icon ? { borderRadius: '40px' } : { borderRadius: '0px' })), onError: (e) => {
40
+ e.currentTarget.src = segmentsIcons[segmentType];
37
41
  e.currentTarget.style.borderRadius = '0px';
38
42
  }, borderColor: "transparent" })) })) }), `${segment.name}-${index}`));
39
43
  }), [segments, isTextShown, theme]);
@@ -4,7 +4,7 @@ export type SegmentsType = keyof typeof segmentsIcons;
4
4
  export interface SegmentInfo {
5
5
  name?: string;
6
6
  icon?: string;
7
- type: SegmentsType;
7
+ type: string;
8
8
  tooltip?: string;
9
9
  }
10
10
  export interface SegmentsCellProps extends TableCellProps {
@@ -6,8 +6,8 @@ export const getSegmentTooltip = (segment) => {
6
6
  case 'institution':
7
7
  prefixKey = 'Payment';
8
8
  break;
9
- case 'platform':
10
- prefixKey = 'Platform';
9
+ default:
10
+ prefixKey = '';
11
11
  break;
12
12
  }
13
13
  return `${prefixKey} ${startCase(segment.type)} - ${segment.name}`;
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.147-test.1",
5
- "testVersion": 1,
4
+ "version": "0.1.147-test.3",
5
+ "testVersion": 3,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",