From 65672fcb24e20de48c8cfd5c46a96f27f28f5a34 Mon Sep 17 00:00:00 2001 From: Aizad Ridzo <103104395+aizad-deriv@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:33:37 +0800 Subject: [PATCH] chore: remove transaction from wallet header (#14485) --- .../WalletsCarouselLoader/WalletsCarouselLoader.tsx | 2 +- .../WalletListCardActions/WalletListCardActions.tsx | 8 +------- .../__tests__/WalletListCardActions.spec.tsx | 9 --------- .../WalletCashierHeader/WalletCashierHeader.tsx | 11 ----------- .../src/public/images/ic-cashier-statement.svg | 10 ---------- 5 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 packages/wallets/src/public/images/ic-cashier-statement.svg diff --git a/packages/wallets/src/components/SkeletonLoader/WalletsCarouselLoader/WalletsCarouselLoader.tsx b/packages/wallets/src/components/SkeletonLoader/WalletsCarouselLoader/WalletsCarouselLoader.tsx index b46ddfdcaa5f..ea8ca05ea35f 100644 --- a/packages/wallets/src/components/SkeletonLoader/WalletsCarouselLoader/WalletsCarouselLoader.tsx +++ b/packages/wallets/src/components/SkeletonLoader/WalletsCarouselLoader/WalletsCarouselLoader.tsx @@ -19,7 +19,7 @@ const WalletsCarouselLoader = () => {
- {Array.from({ length: 4 }).map((_, idx) => ( + {Array.from({ length: 3 }).map((_, idx) => (
{ name: 'transfer', text: 'Transfer', }, - { - icon: , - name: 'transactions', - text: 'Transactions', - }, ] as const; // Filter out the "Withdraw" button when is_demo is true const filteredButtons = isDemo ? buttons.filter(button => button.name !== 'withdraw') : buttons; - const orderForDemo = ['reset-balance', 'transfer', 'transactions']; + const orderForDemo = ['reset-balance', 'transfer']; const sortedButtons = isDemo ? [...filteredButtons].sort((a, b) => orderForDemo.indexOf(a.name) - orderForDemo.indexOf(b.name)) diff --git a/packages/wallets/src/components/WalletListCardActions/__tests__/WalletListCardActions.spec.tsx b/packages/wallets/src/components/WalletListCardActions/__tests__/WalletListCardActions.spec.tsx index b0e31dc729ec..2c1c9c9ce3de 100644 --- a/packages/wallets/src/components/WalletListCardActions/__tests__/WalletListCardActions.spec.tsx +++ b/packages/wallets/src/components/WalletListCardActions/__tests__/WalletListCardActions.spec.tsx @@ -39,7 +39,6 @@ describe('WalletListCardActions', () => { expect(screen.getByText('Deposit')).toBeInTheDocument(); expect(screen.getByText('Withdraw')).toBeInTheDocument(); expect(screen.getByText('Transfer')).toBeInTheDocument(); - expect(screen.getByText('Transactions')).toBeInTheDocument(); }); it('should show the actions texts if the demo wallet is active', () => { @@ -57,7 +56,6 @@ describe('WalletListCardActions', () => { render(, { wrapper }); expect(screen.getByText('Reset balance')).toBeInTheDocument(); expect(screen.getByText('Transfer')).toBeInTheDocument(); - expect(screen.getByText('Transactions')).toBeInTheDocument(); }); it("shouldn't show the actions texts if the real wallet is inactive", () => { @@ -76,7 +74,6 @@ describe('WalletListCardActions', () => { expect(screen.queryByText('Deposit')).not.toBeInTheDocument(); expect(screen.queryByText('Withdraw')).not.toBeInTheDocument(); expect(screen.queryByText('Transfer')).not.toBeInTheDocument(); - expect(screen.queryByText('Transactions')).not.toBeInTheDocument(); }); it('should switch account and redirect to the correct page when clicking on one of the actions and wallet is inactive', () => { @@ -133,12 +130,6 @@ describe('WalletListCardActions', () => { expect(history.location.pathname).toBe('/wallets/cashier/transfer'); }); - it('should redirect to cashier page when clicking on transactions', () => { - render(, { wrapper }); - screen.getByRole('button', { name: 'transactions' }).click(); - expect(history.location.pathname).toBe('/wallets/cashier/transactions'); - }); - it('should redirect to cashier page when clicking on reset balance', () => { (useActiveWalletAccount as jest.Mock).mockReturnValue({ data: { diff --git a/packages/wallets/src/features/cashier/components/WalletCashierHeader/WalletCashierHeader.tsx b/packages/wallets/src/features/cashier/components/WalletCashierHeader/WalletCashierHeader.tsx index 251bead754c0..aad3635ae99e 100644 --- a/packages/wallets/src/features/cashier/components/WalletCashierHeader/WalletCashierHeader.tsx +++ b/packages/wallets/src/features/cashier/components/WalletCashierHeader/WalletCashierHeader.tsx @@ -7,7 +7,6 @@ import { WalletListCardBadge } from '../../../../components/WalletListCardBadge' import useDevice from '../../../../hooks/useDevice'; import CloseIcon from '../../../../public/images/close-icon.svg'; import IcCashierDeposit from '../../../../public/images/ic-cashier-deposit.svg'; -import IcCashierStatement from '../../../../public/images/ic-cashier-statement.svg'; import IcCashierTransfer from '../../../../public/images/ic-cashier-transfer.svg'; import IcCashierWithdrawal from '../../../../public/images/ic-cashier-withdrawal.svg'; import ResetBalance from '../../../../public/images/plus-thin.svg'; @@ -34,11 +33,6 @@ const realAccountTabs = [ path: 'transfer', text: i18n.t('Transfer'), }, - { - icon: , - path: 'transactions', - text: i18n.t('Transactions'), - }, ] as const; const virtualAccountTabs = [ @@ -47,11 +41,6 @@ const virtualAccountTabs = [ path: 'transfer', text: i18n.t('Transfer'), }, - { - icon: , - path: 'transactions', - text: i18n.t('Transactions'), - }, { icon: , path: 'reset-balance', diff --git a/packages/wallets/src/public/images/ic-cashier-statement.svg b/packages/wallets/src/public/images/ic-cashier-statement.svg deleted file mode 100644 index 1ae020809cb9..000000000000 --- a/packages/wallets/src/public/images/ic-cashier-statement.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - -