@tap-payments/os-micro-frontend-shared 0.1.291-test.1-test.2-test.3-test.4-test.5-test.6-test.7-test.8 → 0.1.291-test.1-test.2-test.3-test.4-test.5-test.6-test.7-test.8-test.9
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/AnimatedSpinnerIcon/AnimatedSpinnerIcon.js +1 -1
- package/build/components/TableCells/CustomCells/PayoutReportCell/PayoutReportCell.js +13 -15
- package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +1 -1
- package/build/components/TableCells/CustomCells/PayoutReportCell/style.js +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { spinnerLoadingIcon } from '../../constants/index.js';
|
|
3
3
|
import { StyledAnimatedSpinner } from './style';
|
|
4
4
|
const AnimatedSpinnerIcon = ({ width, height, sx } = {}) => {
|
|
5
|
-
return _jsx(StyledAnimatedSpinner, { src: spinnerLoadingIcon, alt: "Loading", className: "spinner-loader", width: width, height: height, sx: sx });
|
|
5
|
+
return (_jsx(StyledAnimatedSpinner, { src: spinnerLoadingIcon, alt: "Loading", className: "spinner-loader", width: width, height: height, sx: sx, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }));
|
|
6
6
|
};
|
|
7
7
|
export default AnimatedSpinnerIcon;
|
|
@@ -2,21 +2,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { AnimatePresence } from 'framer-motion';
|
|
4
4
|
import Tooltip from '../../../Tooltip';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
if (isDownloadError) {
|
|
9
|
-
return _jsx(DownloadFileIcon, { src: isSettlementsAvailable ? actionFailIcon : fileDownloadGreyIcon, alt: "Download Report" }, "error-icon");
|
|
10
|
-
}
|
|
11
|
-
if (isDownloadSuccess) {
|
|
12
|
-
return _jsx(DownloadFileIcon, { src: isSettlementsAvailable ? actionSuccessIcon : fileDownloadGreyIcon, alt: "Download Report" }, "success-icon");
|
|
13
|
-
}
|
|
14
|
-
if (isDownloadLoading) {
|
|
15
|
-
return _jsx(DownloadFileIcon, { src: isSettlementsAvailable ? spinnerLoadingIcon : fileDownloadGreyIcon, className: "spinner-loader" }, "spinner-icon");
|
|
16
|
-
}
|
|
17
|
-
return _jsx(DownloadFileIcon, { src: isSettlementsAvailable ? fileDownloadBlueIcon : fileDownloadGreyIcon, alt: "Download Report" }, "download-icon");
|
|
18
|
-
};
|
|
5
|
+
import { AnimatedSpinnerIcon } from '../../../index.js';
|
|
6
|
+
import { actionFailIcon, actionSuccessIcon, fileDownloadBlueIcon, fileDownloadGreyIcon } from '../../../../constants/index.js';
|
|
7
|
+
import { StyledDownloadFileImage, StyledDownloadFileImageWrapper } from './style';
|
|
19
8
|
export const PayoutReportCell = ({ onClick, isSettlementsAvailable, isDownloadError, isDownloadLoading, isDownloadSuccess }) => {
|
|
20
9
|
const isDownloadInProgress = useMemo(() => isDownloadLoading || isDownloadSuccess || isDownloadError, [isDownloadLoading, isDownloadSuccess, isDownloadError]);
|
|
21
|
-
|
|
10
|
+
const icon = useMemo(() => {
|
|
11
|
+
if (isDownloadSuccess) {
|
|
12
|
+
return actionSuccessIcon;
|
|
13
|
+
}
|
|
14
|
+
if (isDownloadError) {
|
|
15
|
+
return actionFailIcon;
|
|
16
|
+
}
|
|
17
|
+
return fileDownloadBlueIcon;
|
|
18
|
+
}, [isDownloadSuccess, isDownloadError]);
|
|
19
|
+
return (_jsx(Tooltip, Object.assign({ title: !isSettlementsAvailable ? 'Pending' : '' }, { children: _jsx(StyledDownloadFileImageWrapper, Object.assign({ onClick: () => isSettlementsAvailable && !isDownloadInProgress && onClick() }, { children: _jsx(AnimatePresence, Object.assign({ mode: "wait", initial: false }, { children: isDownloadLoading ? (_jsx(AnimatedSpinnerIcon, {}, "spinner")) : (_jsx(StyledDownloadFileImage, { src: isSettlementsAvailable ? icon : fileDownloadGreyIcon, alt: "Download Report", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }, "download-icon")) })) })) })));
|
|
22
20
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const StyledDownloadFileImageWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
3
3
|
isTextShown?: boolean | undefined;
|
|
4
4
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const StyledDownloadFileImage: import("@emotion/styled").StyledComponent<{
|
|
6
6
|
width?: string | number | undefined;
|
|
7
7
|
height?: string | number | undefined;
|
|
8
8
|
hidden?: boolean | undefined;
|
|
@@ -12,7 +12,7 @@ export const StyledDownloadFileImageWrapper = styled('span')(({ theme }) => ({
|
|
|
12
12
|
minWidth: '36px',
|
|
13
13
|
cursor: 'pointer',
|
|
14
14
|
}));
|
|
15
|
-
export const
|
|
15
|
+
export const StyledDownloadFileImage = styled(motion.img)(() => ({
|
|
16
16
|
width: '16px',
|
|
17
17
|
height: '16px',
|
|
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.291-test.1-test.2-test.3-test.4-test.5-test.6-test.7-test.8",
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.291-test.1-test.2-test.3-test.4-test.5-test.6-test.7-test.8-test.9",
|
|
5
|
+
"testVersion": 9,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|