Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
acd09df
Update styles
iuliacimpeanu Nov 12, 2025
e7673dd
Refactored sign transactions footer
iuliacimpeanu Nov 12, 2025
41ae846
Refactored copy button
iuliacimpeanu Nov 13, 2025
2bc1e68
Refactored button component
iuliacimpeanu Nov 17, 2025
d59bc26
Refactored tooltip component
iuliacimpeanu Nov 17, 2025
19d62af
Refactored spinner icon component
iuliacimpeanu Nov 17, 2025
3ba682d
Refactored arrow right component
iuliacimpeanu Nov 17, 2025
02d264c
Updated copy button
iuliacimpeanu Nov 18, 2025
261b855
Updated styles
iuliacimpeanu Nov 19, 2025
fdf2f20
Refactored sign transactions overview
iuliacimpeanu Nov 19, 2025
0ba5aaf
Refactored sign-transactions-advanced and sign-transactions-header
iuliacimpeanu Nov 21, 2025
4491fa5
Updated styles
iuliacimpeanu Nov 24, 2025
167cbc9
Updated styles
iuliacimpeanu Nov 24, 2025
5233da0
Fixed test
iuliacimpeanu Nov 24, 2025
b4c3cfe
Updated changelog
iuliacimpeanu Nov 24, 2025
3200a83
Merge branch 'development' into ic/feature/refactor-sign-tx-comp
iuliacimpeanu Nov 24, 2025
ebe6931
Updated changelog
iuliacimpeanu Nov 24, 2025
0b32a02
Updated files
iuliacimpeanu Nov 24, 2025
aad9c3f
Fixes after review
iuliacimpeanu Nov 25, 2025
0c3bc83
Fixes after review
iuliacimpeanu Nov 25, 2025
fb0ead5
Updates files location
iuliacimpeanu Nov 25, 2025
4a3a1f2
Merge branch 'development' into ic-feature-refactor
iuliacimpeanu Nov 25, 2025
c9fb834
Merge branch 'development' into ic-feature-refactor
iuliacimpeanu Nov 26, 2025
0a9f541
Refactored side-panel-header comp
iuliacimpeanu Nov 27, 2025
a2d8288
Merge branch 'development' into ic-feature-refactor
iuliacimpeanu Nov 27, 2025
2ca87b7
Refactored side-panel comp
iuliacimpeanu Dec 2, 2025
41cb157
Refactored side-panel-swipper styles
iuliacimpeanu Dec 2, 2025
b9b32c6
Refactored side panel swiper component.
iuliacimpeanu Dec 3, 2025
e2dfbcb
Updated components
iuliacimpeanu Dec 3, 2025
40be45a
Updated styles
iuliacimpeanu Dec 3, 2025
8984ff9
Updated changelog
iuliacimpeanu Dec 4, 2025
517f7a2
Fixed test
iuliacimpeanu Dec 4, 2025
aa4997d
Fixes after review
iuliacimpeanu Dec 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- [Refactored side panel components](https://github.com/multiversx/mx-sdk-dapp-ui/pull/271)
- [Fixed trimmed address not showing in address-table](https://github.com/multiversx/mx-sdk-dapp-ui/pull/273)
- [Added minimize/maximize action for toasts](https://github.com/multiversx/mx-sdk-dapp-ui/pull/272)
- [Eslint and prettierrc fixes](https://github.com/multiversx/mx-sdk-dapp-ui/pull/270)
Expand Down
5 changes: 3 additions & 2 deletions src/common/ProviderIdleScreen/ProviderIdleScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { IProviderBase } from 'types/provider.types';
import { ProviderTypeEnum } from 'types/provider.types';

import { getProviderIntroText } from './helpers/getProviderIntroText';
import { SidePanelHeader } from 'components/visual/SidePanel/components/SidePanelHeader/SidePanelHeader';

const styles = {
container: 'mvx:flex mvx:flex-col mvx:flex-1 mvx:overflow-hidden',
Expand Down Expand Up @@ -50,7 +51,7 @@ export function ProviderIdleScreen({
if (provider.type === ProviderTypeEnum.ledger) {
return (
<Fragment>
<mvx-side-panel-header hasLeftButton={false} panelTitle={provider.name} onRightButtonClick={onClose} />
<SidePanelHeader hasLeftButton={false} panelTitle={provider.name} onRightButtonClick={onClose} />

<mvx-ledger-intro onConnect={onAccess} />
</Fragment>
Expand All @@ -59,7 +60,7 @@ export function ProviderIdleScreen({

return (
<div class={styles.container}>
<mvx-side-panel-header hasLeftButton={false} panelTitle={provider.name} onRightButtonClick={onClose} />
<SidePanelHeader hasLeftButton={false} panelTitle={provider.name} onRightButtonClick={onClose} />

<div class={styles.intro} style={{ color: 'var(--mvx-text-color-primary)' }}>
<div class={styles.icon}>{providerIntroIcon}</div>
Expand Down
180 changes: 0 additions & 180 deletions src/components.d.ts

Large diffs are not rendered by default.

28 changes: 0 additions & 28 deletions src/components/common/unlock-button/unlock-button.tsx

This file was deleted.

7 changes: 4 additions & 3 deletions src/components/functional/ledger-connect/ledger-connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { EventBus, type IEventBus } from 'utils/EventBus';
import { getLedgerAddressByIndex } from './helpers/getLedgerAddressByIndex';
import type { ILedgerConnectPanelData } from './ledger-connect.types';
import { LedgerConnectEventsEnum } from './ledger-connect.types';
import { SidePanelHeader } from 'components/visual/SidePanel/components/SidePanelHeader/SidePanelHeader';

// prettier-ignore
const styles = {
Expand Down Expand Up @@ -89,7 +90,7 @@ export class LedgerConnect {
if (this.ledgerDataState.accountScreenData) {
return (
<Host class={styles.ledgerConnectHost}>
<mvx-side-panel-header
<SidePanelHeader
panelTitle={providerLabels.ledger}
hasLeftButton={false}
onRightButtonClick={this.handleClose.bind(this)}
Expand All @@ -111,7 +112,7 @@ export class LedgerConnect {
if (this.ledgerDataState.confirmScreenData) {
return (
<Host class={styles.ledgerConnectHost}>
<mvx-side-panel-header
<SidePanelHeader
panelTitle={providerLabels.ledger}
hasLeftButton={false}
onRightButtonClick={this.handleClose.bind(this)}
Expand All @@ -124,7 +125,7 @@ export class LedgerConnect {

return (
<Host class={styles.ledgerConnectHost}>
<mvx-side-panel-header
<SidePanelHeader
panelTitle={providerLabels.ledger}
hasLeftButton={false}
onRightButtonClick={this.handleClose.bind(this)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}

// Ensure children don't cause horizontal scroll
> * {
>* {
@apply mvx:w-full mvx:max-w-full mvx:box-border;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Component, h, Method, State } from '@stencil/core';
import { Icon } from 'common/Icon';
import { SidePanel } from 'components/visual/SidePanel/SidePanel';
import { ConnectionMonitor } from 'utils/ConnectionMonitor';
import type { IEventBus } from 'utils/EventBus';
import { EventBus } from 'utils/EventBus';

import type { ITransactionListItem } from '../../visual/transaction-list-item/transaction-list-item.types';
import type { ITransactionToast } from '../toasts-list/components/transaction-toast/transaction-toast.type';
import { NotificationsFeedEventsEnum } from './notifications-feed.types';
import { ANIMATION_DELAY_PROMISE } from 'components/visual/SidePanel/sidePanel.constants';

@Component({
tag: 'mvx-notifications-feed',
Expand All @@ -26,7 +28,7 @@ export class NotificationsFeed {

@Method() async closeWithAnimation() {
this.isOpen = false;
const animationDelay = await new Promise(resolve => setTimeout(resolve, 300));
const animationDelay = await ANIMATION_DELAY_PROMISE;
return animationDelay;
}

Expand Down Expand Up @@ -91,7 +93,7 @@ export class NotificationsFeed {
const hasPending = this.pendingTransactions?.length > 0;

return (
<mvx-side-panel
<SidePanel
isOpen={this.isOpen}
panelTitle="Notifications Feed"
onClose={this.handleClose}
Expand Down Expand Up @@ -131,7 +133,7 @@ export class NotificationsFeed {
</div>
</div>
</div>
</mvx-side-panel>
</SidePanel>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
align-items: center;
flex: 1;
padding: 16px;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, h, Method, State } from '@stencil/core';
import { ProviderIdleScreen } from 'common/ProviderIdleScreen/ProviderIdleScreen';
import { ANIMATION_DELAY_PROMISE } from 'components/visual/side-panel/side-panel.constants';
import { ANIMATION_DELAY_PROMISE } from 'components/visual/SidePanel/sidePanel.constants';
import { SidePanel } from 'components/visual/SidePanel/SidePanel';
import type { IProviderBase } from 'types/provider.types';
import { ProviderTypeEnum } from 'types/provider.types';
import { ConnectionMonitor } from 'utils/ConnectionMonitor';
Expand Down Expand Up @@ -76,7 +77,11 @@ export class PendingTransactionsPanel {

render() {
return (
<mvx-side-panel isOpen={this.isOpen} panelTitle={this?.provider?.name} showHeader={false}>
<SidePanel
isOpen={this.isOpen}
panelTitle={this?.provider?.name}
showHeader={false}
>
<ProviderIdleScreen
provider={this.provider}
onClose={this.handleClose}
Expand All @@ -85,7 +90,7 @@ export class PendingTransactionsPanel {
>
<button onClick={this.handleClose}>Close</button>
</ProviderIdleScreen>
</mvx-side-panel>
</SidePanel>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ describe('pending-transactions-panel', () => {
});

page.rootInstance.provider = { name: title };
page.rootInstance.isOpen = true;
await page.waitForChanges();

const panel = page.root.shadowRoot.querySelector('mvx-side-panel');
const panel = page.root.shadowRoot.querySelector('#side-panel');
expect(panel).toBeTruthy();

const panelTitle = panel.getAttribute('panelTitle');
expect(panelTitle).toBe(title);
expect(page.rootInstance.provider?.name).toBe(title);
expect(page.rootInstance.isOpen).toBe(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@

.trim-right {
@apply mvx:select-none mvx:pointer-events-none mvx:inline mvx:text-base mvx:leading-5 mvx:text-clip;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, h, Method, State } from '@stencil/core';
import { getCopyClickAction } from 'common/CopyButton/getCopyClickAction';
import { ANIMATION_DELAY_PROMISE } from 'components/visual/side-panel/side-panel.constants';
import { ANIMATION_DELAY_PROMISE } from 'components/visual/SidePanel/sidePanel.constants';
import { SidePanel } from 'components/visual/SidePanel/SidePanel';
import { DataTestIdsEnum } from 'constants/dataTestIds.enum';
import { ConnectionMonitor } from 'utils/ConnectionMonitor';
import type { IEventBus } from 'utils/EventBus';
Expand Down Expand Up @@ -148,7 +149,7 @@ export class SignTransactionsPanel {
const { currentIndex, transactionsCount, origin } = commonData;

return (
<mvx-side-panel
<SidePanel
isOpen={this.isOpen}
onClose={this.handleClose}
panelTitle="Confirm Transaction"
Expand Down Expand Up @@ -201,7 +202,7 @@ export class SignTransactionsPanel {
handleCopyButtonClick={this.handleCopyButtonClick}
/>
</div>
</mvx-side-panel>
</SidePanel>
);
}
}
2 changes: 1 addition & 1 deletion src/components/functional/unlock-panel/unlock-panel.scss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// This is needed to trigger the Stecil Tailwind compilation for inline Tailwind classes.
// This is needed to trigger the Stecil Tailwind compilation for inline Tailwind classes.
7 changes: 4 additions & 3 deletions src/components/functional/unlock-panel/unlock-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, Element, h, Method, State } from '@stencil/core';
import { ProviderIdleScreen } from 'common/ProviderIdleScreen/ProviderIdleScreen';
import { ANIMATION_DELAY_PROMISE } from 'components/visual/side-panel/side-panel.constants';
import { ANIMATION_DELAY_PROMISE } from 'components/visual/SidePanel/sidePanel.constants';
import { SidePanel } from 'components/visual/SidePanel/SidePanel';
import type { IProviderBase } from 'types/provider.types';
import { ProviderTypeEnum } from 'types/provider.types';
import { ConnectionMonitor } from 'utils/ConnectionMonitor';
Expand Down Expand Up @@ -159,7 +160,7 @@ export class UnlockPanel {
const isCustomProviderActive = this.selectedMethod && this.isCustomProvider(this.selectedMethod.type);

return (
<mvx-side-panel
<SidePanel
isOpen={this.isOpen}
panelTitle={panelTitle}
onClose={this.handleClose}
Expand Down Expand Up @@ -210,7 +211,7 @@ export class UnlockPanel {
<UnlockPanelFooter walletAddress={this.walletAddress} />
</div>
)}
</mvx-side-panel>
</SidePanel>
);
}
}
11 changes: 5 additions & 6 deletions src/components/functional/wallet-connect/wallet-connect.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, Element, h, Host, Method, Prop, State, Watch } from '@stencil/core';
import { Icon } from 'common/Icon';
import type { IEventBus, IWalletConnectPanelData } from 'components';
import { SidePanelHeaderSlotEnum } from 'components/visual/side-panel/components/side-panel-header/side-panel-header';
import { providerLabels } from 'constants/providerFactory.constants';
import QRCode from 'qrcode';
import { ConnectionMonitor } from 'utils/ConnectionMonitor';
import { EventBus } from 'utils/EventBus';

import { WalletConnectEventsEnum } from './wallet-connect.types';
import { SidePanelHeader } from 'components/visual/SidePanel/components/SidePanelHeader/SidePanelHeader';

// prettier-ignore
const styles = {
Expand Down Expand Up @@ -86,16 +86,15 @@ export class WalletConnect {
render() {
return (
<Host class={styles.walletConnectHost}>
<mvx-side-panel-header
<SidePanelHeader
hasRightButton={true}
hasLeftButton={!this.showScanPage}
panelTitle={providerLabels.walletConnect}
onLeftButtonClick={this.handlePageToggle.bind(this)}
onRightButtonClick={() => this.eventBus.publish(WalletConnectEventsEnum.CLOSE)}
>
{!this.showScanPage && <Icon name="back-arrow" slot={SidePanelHeaderSlotEnum.leftIcon} />}
<Icon name="close" slot={SidePanelHeaderSlotEnum.rightIcon} />
</mvx-side-panel-header>
leftIcon={!this.showScanPage ? <Icon name="back-arrow" /> : undefined}
rightIcon={<Icon name="close" />}
/>

<div class={styles.walletConnect}>
{this.showScanPage ? (
Expand Down
87 changes: 87 additions & 0 deletions src/components/visual/SidePanel/SidePanel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { h } from '@stencil/core';
import classNames from 'classnames';
import { SidePanelHeader } from './components/SidePanelHeader/SidePanelHeader';
import { SidePanelSwiper } from './components/SidePanelSwiper/SidePanelSwiper';
import { handleSidePanelOpenChange } from './helpers/handleSidePanelOpenChange';
import { state } from './sidePanelStore';

import styles from './sidePanel.styles';

interface SidePanelPropsType {
isOpen?: boolean;
panelClassName?: string;
panelTitle: string;
hasBackButton?: boolean;
showHeader?: boolean;
onClose?: () => void;
onBack?: () => void;
}

export function SidePanel({
isOpen = false,
panelClassName,
panelTitle,
hasBackButton,
showHeader = true,
onClose,
onBack
}: SidePanelPropsType, children: JSX.Element) {
if (isOpen !== undefined) {
handleSidePanelOpenChange(isOpen, (shouldAnimate) => {
state.shouldAnimate = shouldAnimate;
});
}

const sidePanelIdentifier = 'side-panel';
const shouldAnimate = state.shouldAnimate;

const handleOverlayClick = (event: MouseEvent) => {
if (event.target === event.currentTarget) {
onClose?.();
}
};

const handleCloseClick = (event: MouseEvent) => {
event.preventDefault();
onClose?.();
};

const handleBackClick = (event: MouseEvent) => {
event.preventDefault();
onBack?.();
};

return (
<div
onClick={handleOverlayClick}
class={classNames([styles.sidePanelWrapper], { [styles.sidePanelWrapperVisible]: shouldAnimate })}
>
<SidePanelSwiper
open={shouldAnimate}
onSheetDismiss={onClose}
>
<div
id={sidePanelIdentifier}
class={classNames([styles.sidePanel], { [styles.sidePanelVisible]: shouldAnimate }, panelClassName)}
>
{showHeader && (
<SidePanelHeader
panelTitle={panelTitle}
panelClassName={panelClassName}
hasLeftButton={hasBackButton}
onRightButtonClick={handleCloseClick}
onLeftButtonClick={handleBackClick}
/>
)}

<div
class={styles.sidePanelContent}
>
{children}
</div>
</div>
</SidePanelSwiper>
</div>
);
}

Loading