@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.
@@ -12786,9 +12786,6 @@ const ProcessingStep = props => {
12786
12786
  psProcessingText,
12787
12787
  psButtonDisabled
12788
12788
  } = props;
12789
- const {
12790
- isModern
12791
- } = useTheme();
12792
12789
  let processStatus = Status.PROCESSING;
12793
12790
  if (isError) {
12794
12791
  processStatus = Status.FAILED;
@@ -12796,22 +12793,21 @@ const ProcessingStep = props => {
12796
12793
  if (isSuccess) {
12797
12794
  processStatus = Status.SUCCEEDED;
12798
12795
  }
12796
+ useEffect(() => {
12797
+ if (processStatus !== Status.PROCESSING) {
12798
+ onAnimationCompleted(processStatus);
12799
+ }
12800
+ }, [processStatus, onAnimationCompleted]);
12799
12801
  return /*#__PURE__*/jsx("div", {
12800
12802
  className: "droppable-processing-card droppable-card",
12801
12803
  "aria-hidden": isComplete,
12802
12804
  children: /*#__PURE__*/jsxs("div", {
12803
12805
  className: "droppable-card-content",
12804
12806
  children: [/*#__PURE__*/jsx(ProcessIndicator$1, {
12805
- size: Size.Small,
12806
- status: processStatus,
12807
- onAnimationCompleted: status => onAnimationCompleted(status)
12807
+ size: Size.SMALL,
12808
+ status: processStatus
12808
12809
  }), /*#__PURE__*/jsx(Title, {
12809
- className: classNames({
12810
- 'm-t-3': !isModern,
12811
- 'm-b-3': !isModern,
12812
- 'm-t-2': isModern,
12813
- 'm-b-2': isModern
12814
- }),
12810
+ className: "m-t-2 m-b-2",
12815
12811
  type: Typography.TITLE_BODY,
12816
12812
  "aria-live": "polite",
12817
12813
  children: psProcessingText
@@ -12998,31 +12994,24 @@ class Upload extends Component {
12998
12994
  fileName
12999
12995
  } = this.state;
13000
12996
  // Success.
13001
- const {
13002
- animationDelay
13003
- } = this.props;
13004
12997
  if (isProcessing && status === Status.SUCCEEDED) {
13005
12998
  const {
13006
12999
  onSuccess
13007
13000
  } = this.props;
13008
- this.timeouts = setTimeout(() => {
13009
- this.setState({
13010
- isProcessing: false,
13011
- isComplete: true
13012
- }, () => onSuccess ? onSuccess(response, fileName) : {});
13013
- }, animationDelay);
13001
+ this.setState({
13002
+ isProcessing: false,
13003
+ isComplete: true
13004
+ }, () => onSuccess ? onSuccess(response, fileName) : {});
13014
13005
  }
13015
13006
  // Failure.
13016
13007
  if (isProcessing && status === Status.FAILED) {
13017
13008
  const {
13018
13009
  onFailure
13019
13010
  } = this.props;
13020
- this.timeouts = setTimeout(() => {
13021
- this.setState({
13022
- isProcessing: false,
13023
- isComplete: true
13024
- }, () => onFailure ? onFailure(response) : {});
13025
- }, animationDelay);
13011
+ this.setState({
13012
+ isProcessing: false,
13013
+ isComplete: true
13014
+ }, () => onFailure ? onFailure(response) : {});
13026
13015
  }
13027
13016
  };
13028
13017
  asyncPost = file => {
@@ -13290,7 +13279,7 @@ Upload.propTypes = {
13290
13279
  uploadStep: PropTypes.oneOf(['uploadImageStep', 'mediaUploadStep'])
13291
13280
  };
13292
13281
  Upload.defaultProps = {
13293
- animationDelay: 700,
13282
+ animationDelay: 0,
13294
13283
  csButtonText: undefined,
13295
13284
  csFailureText: undefined,
13296
13285
  csSuccessText: undefined,