Skip to content

Commit a41ec30

Browse files
Refactor get animation delay (#287)
* Refactor ANIMATION_DELAY_PROMISE to `getAnimationDelay` * Update CHANGELOG
1 parent 5cc170f commit a41ec30

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- [Refactored side panel helper to `getAnimationDelay`](https://github.com/multiversx/mx-sdk-dapp-ui/pull/287)
1011

1112
## [[0.1.9](https://github.com/multiversx/mx-sdk-dapp-ui/pull/286)] - 2026-01-13
1213

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const getAnimationDelay = () => new Promise(resolve => setTimeout(resolve, 300));

src/common/SidePanel/sidePanel.constants.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/functional/notifications-feed/notifications-feed.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, h, Method, State } from '@stencil/core';
22
import { Icon } from 'common/Icon';
3+
import { getAnimationDelay } from 'common/SidePanel/helpers/getAnimationDelay';
34
import { SidePanel } from 'common/SidePanel/SidePanel';
4-
import { ANIMATION_DELAY_PROMISE } from 'common/SidePanel/sidePanel.constants';
55
import { TransactionListItem } from 'components/functional/notifications-feed/components/TransactionListItem/TransactionListItem';
66
import type { ITransactionListItem } from 'components/functional/notifications-feed/components/TransactionListItem/transactionListItem.types';
77
import { ConnectionMonitor } from 'utils/ConnectionMonitor';
@@ -29,7 +29,7 @@ export class NotificationsFeed {
2929

3030
@Method() async closeWithAnimation() {
3131
this.isOpen = false;
32-
const animationDelay = await ANIMATION_DELAY_PROMISE();
32+
const animationDelay = await getAnimationDelay();
3333
return animationDelay;
3434
}
3535

src/components/functional/pending-transactions-panel/pending-transactions-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, h, Method, State } from '@stencil/core';
22
import { ProviderIdleScreen } from 'common/ProviderIdleScreen/ProviderIdleScreen';
3+
import { getAnimationDelay } from 'common/SidePanel/helpers/getAnimationDelay';
34
import { SidePanel } from 'common/SidePanel/SidePanel';
4-
import { ANIMATION_DELAY_PROMISE } from 'common/SidePanel/sidePanel.constants';
55
import type { IProviderBase } from 'types/provider.types';
66
import { ProviderTypeEnum } from 'types/provider.types';
77
import { ConnectionMonitor } from 'utils/ConnectionMonitor';
@@ -45,7 +45,7 @@ export class PendingTransactionsPanel {
4545

4646
@Method() async closeWithAnimation() {
4747
this.isOpen = false;
48-
const animationDelay = await ANIMATION_DELAY_PROMISE();
48+
const animationDelay = await getAnimationDelay();
4949
return animationDelay;
5050
}
5151

src/components/functional/sign-transactions-panel/sign-transactions-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, h, Method, State } from '@stencil/core';
22
import { getCopyClickAction } from 'common/CopyButton/getCopyClickAction';
3+
import { getAnimationDelay } from 'common/SidePanel/helpers/getAnimationDelay';
34
import { SidePanel } from 'common/SidePanel/SidePanel';
4-
import { ANIMATION_DELAY_PROMISE } from 'common/SidePanel/sidePanel.constants';
55
import { DataTestIdsEnum } from 'constants/dataTestIds.enum';
66
import { ConnectionMonitor } from 'utils/ConnectionMonitor';
77
import type { IEventBus } from 'utils/EventBus';
@@ -28,7 +28,7 @@ export class SignTransactionsPanel {
2828

2929
@Method() async closeWithAnimation() {
3030
this.isOpen = false;
31-
const animationDelay = await ANIMATION_DELAY_PROMISE();
31+
const animationDelay = await getAnimationDelay();
3232
return animationDelay;
3333
}
3434

src/components/functional/unlock-panel/unlock-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, Element, h, Method, State } from '@stencil/core';
22
import { ProviderIdleScreen } from 'common/ProviderIdleScreen/ProviderIdleScreen';
3+
import { getAnimationDelay } from 'common/SidePanel/helpers/getAnimationDelay';
34
import { SidePanel } from 'common/SidePanel/SidePanel';
4-
import { ANIMATION_DELAY_PROMISE } from 'common/SidePanel/sidePanel.constants';
55
import type { IProviderBase } from 'types/provider.types';
66
import { ProviderTypeEnum } from 'types/provider.types';
77
import { ConnectionMonitor } from 'utils/ConnectionMonitor';
@@ -42,7 +42,7 @@ export class UnlockPanel {
4242

4343
@Method() async closeWithAnimation() {
4444
this.isOpen = false;
45-
const animationDelay = await ANIMATION_DELAY_PROMISE();
45+
const animationDelay = await getAnimationDelay();
4646
return animationDelay;
4747
}
4848

0 commit comments

Comments
 (0)