@tap-payments/os-micro-frontend-shared 0.1.90-test.21 → 0.1.90-test.23
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/components/StatusIcons/DestinationIcon/DestinationIcon.d.ts +5 -2
- package/build/components/StatusIcons/DestinationIcon/DestinationIcon.js +13 -5
- package/build/components/StatusIcons/PayoutIcon/PayoutIcon.d.ts +5 -1
- package/build/components/StatusIcons/PayoutIcon/PayoutIcon.js +8 -3
- package/package.json +2 -2
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { DestinationStatus } from '../../../types/index.js';
|
|
2
|
-
export declare function DestinationIcon({ status, isTextShown, }: Readonly<{
|
|
1
|
+
import { DestinationStatus, SelectionProps } from '../../../types/index.js';
|
|
2
|
+
export declare function DestinationIcon({ status, isTextShown, isSheetViewShown, chipIndex, selectionProps, }: Readonly<{
|
|
3
3
|
status: DestinationStatus;
|
|
4
4
|
isTextShown?: boolean;
|
|
5
|
+
isSheetViewShown?: boolean;
|
|
6
|
+
chipIndex?: number;
|
|
7
|
+
selectionProps?: SelectionProps;
|
|
5
8
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,10 +5,18 @@ import Tooltip from '../../Tooltip';
|
|
|
5
5
|
import { camelCase } from 'lodash';
|
|
6
6
|
import { useTheme } from '@mui/material';
|
|
7
7
|
import { t } from 'i18next';
|
|
8
|
-
|
|
8
|
+
import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
9
|
+
export function DestinationIcon({ status, isTextShown, isSheetViewShown, chipIndex = 0, selectionProps = {}, }) {
|
|
9
10
|
const theme = useTheme();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const statusText = t(camelCase(status));
|
|
12
|
+
if (isSheetViewShown && destinationStatusIcons[status]) {
|
|
13
|
+
return (_jsx(StatusChipWithCopy, Object.assign({ copyText: statusText, chipIndex: chipIndex, selectionProps: selectionProps }, { children: statusText })));
|
|
14
|
+
}
|
|
15
|
+
if (isTextShown && destinationStatusIcons[status]) {
|
|
16
|
+
return (_jsx(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(status), sx: {
|
|
17
|
+
background: '#1F88D00D',
|
|
18
|
+
color: status === 'PROCESSED' ? theme.palette.info.dark : theme.palette.common.black,
|
|
19
|
+
} }, { children: statusText })));
|
|
20
|
+
}
|
|
21
|
+
return (_jsx(StatusIconWrapper, Object.assign({ className: "destination-status" }, { children: status && destinationStatusIcons[status] && (_jsx(Tooltip, Object.assign({ title: t(camelCase(status)) }, { children: _jsx(StatusIcon, { src: destinationStatusIcons[status], alt: "destination-icon" }) }))) })));
|
|
14
22
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PayoutStatusType } from '../../TableCells';
|
|
3
|
+
import { SelectionProps } from '../../../types/index.js';
|
|
3
4
|
type PayoutIconProps = {
|
|
4
5
|
iconStyles?: React.CSSProperties;
|
|
5
6
|
payoutStatus?: PayoutStatusType;
|
|
6
7
|
payoutTooltip?: React.ReactNode;
|
|
7
8
|
isTextShown?: boolean;
|
|
9
|
+
isSheetViewShown?: boolean;
|
|
10
|
+
chipIndex?: number;
|
|
11
|
+
selectionProps?: SelectionProps;
|
|
8
12
|
};
|
|
9
|
-
export declare const PayoutIcon: ({ payoutStatus, isTextShown, payoutTooltip, iconStyles }: PayoutIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const PayoutIcon: ({ payoutStatus, isTextShown, payoutTooltip, iconStyles, isSheetViewShown, chipIndex, selectionProps, }: PayoutIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
export {};
|
|
@@ -5,8 +5,13 @@ import Tooltip from '../../Tooltip';
|
|
|
5
5
|
import { StatusIcon } from '../../TableCells/CustomCells/style';
|
|
6
6
|
import { StatusTextLabel } from '../../TableCells/CustomCells/InvoiceStatusCell/style';
|
|
7
7
|
import { payoutStatusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
8
|
-
|
|
8
|
+
import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
9
|
+
export const PayoutIcon = ({ payoutStatus = 'PENDING', isTextShown, payoutTooltip, iconStyles, isSheetViewShown, chipIndex = 0, selectionProps = {}, }) => {
|
|
9
10
|
const { t } = useTranslation();
|
|
10
|
-
const
|
|
11
|
-
|
|
11
|
+
const statusText = t(camelCase(payoutStatus));
|
|
12
|
+
const title = payoutTooltip ? payoutTooltip : statusText;
|
|
13
|
+
if (isSheetViewShown) {
|
|
14
|
+
return (_jsx(StatusChipWithCopy, Object.assign({ chipIndex: chipIndex, copyText: statusText, selectionProps: selectionProps }, { children: statusText })));
|
|
15
|
+
}
|
|
16
|
+
return (_jsx(Tooltip, Object.assign({ title: title }, { children: isTextShown ? (_jsx(StatusTextLabel, Object.assign({ "data-testid": "StatusCell_PayoutStatusLabel" }, { children: statusText }))) : (_jsx(StatusIcon, { src: payoutStatusIcons[payoutStatus], alt: "settled-icon", "data-testid": "StatusCell_PayoutStatusIcon", style: iconStyles })) })));
|
|
12
17
|
};
|
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.90-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.90-test.23",
|
|
5
|
+
"testVersion": 23,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|