@transferwise/components 0.0.0-experimental-0df7ed4 → 0.0.0-experimental-75135c1
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/index.esm.js +17 -28
- package/build/index.esm.js.map +1 -1
- package/build/index.js +17 -28
- package/build/index.js.map +1 -1
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/upload/steps/processingStep/processingStep.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/upload/Upload.js +15 -20
- package/src/upload/steps/processingStep/processingStep.js +9 -19
package/build/index.js
CHANGED
|
@@ -12819,9 +12819,6 @@ const ProcessingStep = props => {
|
|
|
12819
12819
|
psProcessingText,
|
|
12820
12820
|
psButtonDisabled
|
|
12821
12821
|
} = props;
|
|
12822
|
-
const {
|
|
12823
|
-
isModern
|
|
12824
|
-
} = componentsTheming.useTheme();
|
|
12825
12822
|
let processStatus = exports.Status.PROCESSING;
|
|
12826
12823
|
if (isError) {
|
|
12827
12824
|
processStatus = exports.Status.FAILED;
|
|
@@ -12829,22 +12826,21 @@ const ProcessingStep = props => {
|
|
|
12829
12826
|
if (isSuccess) {
|
|
12830
12827
|
processStatus = exports.Status.SUCCEEDED;
|
|
12831
12828
|
}
|
|
12829
|
+
React.useEffect(() => {
|
|
12830
|
+
if (processStatus !== exports.Status.PROCESSING) {
|
|
12831
|
+
onAnimationCompleted(processStatus);
|
|
12832
|
+
}
|
|
12833
|
+
}, [processStatus, onAnimationCompleted]);
|
|
12832
12834
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
12833
12835
|
className: "droppable-processing-card droppable-card",
|
|
12834
12836
|
"aria-hidden": isComplete,
|
|
12835
12837
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12836
12838
|
className: "droppable-card-content",
|
|
12837
12839
|
children: [/*#__PURE__*/jsxRuntime.jsx(ProcessIndicator$1, {
|
|
12838
|
-
size: exports.Size.
|
|
12839
|
-
status: processStatus
|
|
12840
|
-
onAnimationCompleted: status => onAnimationCompleted(status)
|
|
12840
|
+
size: exports.Size.SMALL,
|
|
12841
|
+
status: processStatus
|
|
12841
12842
|
}), /*#__PURE__*/jsxRuntime.jsx(Title, {
|
|
12842
|
-
className:
|
|
12843
|
-
'm-t-3': !isModern,
|
|
12844
|
-
'm-b-3': !isModern,
|
|
12845
|
-
'm-t-2': isModern,
|
|
12846
|
-
'm-b-2': isModern
|
|
12847
|
-
}),
|
|
12843
|
+
className: "m-t-2 m-b-2",
|
|
12848
12844
|
type: exports.Typography.TITLE_BODY,
|
|
12849
12845
|
"aria-live": "polite",
|
|
12850
12846
|
children: psProcessingText
|
|
@@ -13031,31 +13027,24 @@ class Upload extends React.Component {
|
|
|
13031
13027
|
fileName
|
|
13032
13028
|
} = this.state;
|
|
13033
13029
|
// Success.
|
|
13034
|
-
const {
|
|
13035
|
-
animationDelay
|
|
13036
|
-
} = this.props;
|
|
13037
13030
|
if (isProcessing && status === exports.Status.SUCCEEDED) {
|
|
13038
13031
|
const {
|
|
13039
13032
|
onSuccess
|
|
13040
13033
|
} = this.props;
|
|
13041
|
-
this.
|
|
13042
|
-
|
|
13043
|
-
|
|
13044
|
-
|
|
13045
|
-
}, () => onSuccess ? onSuccess(response, fileName) : {});
|
|
13046
|
-
}, animationDelay);
|
|
13034
|
+
this.setState({
|
|
13035
|
+
isProcessing: false,
|
|
13036
|
+
isComplete: true
|
|
13037
|
+
}, () => onSuccess ? onSuccess(response, fileName) : {});
|
|
13047
13038
|
}
|
|
13048
13039
|
// Failure.
|
|
13049
13040
|
if (isProcessing && status === exports.Status.FAILED) {
|
|
13050
13041
|
const {
|
|
13051
13042
|
onFailure
|
|
13052
13043
|
} = this.props;
|
|
13053
|
-
this.
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
}, () => onFailure ? onFailure(response) : {});
|
|
13058
|
-
}, animationDelay);
|
|
13044
|
+
this.setState({
|
|
13045
|
+
isProcessing: false,
|
|
13046
|
+
isComplete: true
|
|
13047
|
+
}, () => onFailure ? onFailure(response) : {});
|
|
13059
13048
|
}
|
|
13060
13049
|
};
|
|
13061
13050
|
asyncPost = file => {
|
|
@@ -13323,7 +13312,7 @@ Upload.propTypes = {
|
|
|
13323
13312
|
uploadStep: PropTypes__default.default.oneOf(['uploadImageStep', 'mediaUploadStep'])
|
|
13324
13313
|
};
|
|
13325
13314
|
Upload.defaultProps = {
|
|
13326
|
-
animationDelay:
|
|
13315
|
+
animationDelay: 0,
|
|
13327
13316
|
csButtonText: undefined,
|
|
13328
13317
|
csFailureText: undefined,
|
|
13329
13318
|
csSuccessText: undefined,
|